Docker Build Gitlab-ce
No Internet environment, external Docker pull [image],docker save [Image] > [Image].tar, under LAN Docker load < [Image].tar
First, create an empty container volume to facilitate data backup migration:
sudo docker pull Ubuntu;
sudo docker run \
--volume/home/fay/gitlabdb/gitlab/config:/etc/gitlab \
--volume/home/fay/gitlabdb/gitlab /logs:/var/log/gitlab \
--volume/home/fay/gitlabdb/gitlab/data:/var/opt/gitlab \
--name fay-gitlabdb Ubuntu/bin/bash
Then create a GITLAB-CE container that uses the above GITLABDB data volume (the GITLABDB is mounted to the container):
sudo docker pull gitlab/gitlab-ce;
sudo docker run--detach \
--hostname 0.0.0.0 \
--publish 10443:443--publish 80:80--publish 1022:22 \
--name FAY-GITLABCE \
--restart always \
--volumes-from gitlabdb \
gitlab/gitlab-ce:latest
Data backup:
sudo docker run--volumes-from gitlabdb \
-V $ (PWD):/backup ubuntu \
tar cvf/backup/backup.tar \
/etc/gitlab /var/log/gitlab/var/opt/gitlab
Data migration:
sudo docker pull BusyBox
sudo docker run \
--volume/home/fay/gitlabdb/gitlab/config:/etc/gitlab \
--volume/home/fay/gitlabdb/gitlab /logs:/var/log/gitlab \
--volume/home/fay/gitlabdb/gitlab/data:/var/opt/gitlab \
--name fay-gitlabdb Ubuntu/bin/bash
sudo docker run--volumes-from gitlabdb \
v $ (PWD):/backup busybox \
tar Xvf/backup/backup.tar