1. Pull the GitLab Chinese version image
docker pull beginor/gitlab-ce:11.3.0-ce.0
2. Verify whether the image is pulled successfully
docker images
3. Create a GitLab mount directory and authorize permissions
mkdir -p /home/gitlab/etc
mkdir -p /home/gitlab/log
mkdir -p /home/gitlab/data
chmod 777 /home/gitlab/etc
chmod 777 /home/gitlab/log
chmod 777 /home/gitlab/data
Fourth, create and start the GitLab container
docker run \
--detach \
--publish 8443:443 \
--publish 8090:80 \
--name gitlab \
--restart always \
-v /home/gitlab/etc:/etc/gitlab \
-v /home/gitlab/log:/var/log/gitlab \
-v /home/gitlab/data:/var/opt/gitlab \
beginor/gitlab-ce:11.3.0-ce.0
5. Verify that the container is running successfully
docker ps
6. Configure the GitLab hostname
1. Modify /home/gitlab/etc/gitlab.rb and change external_url to host domain name or IP address
vi /home/gitlab/etc/gitlab.rb
/external_url Enter to find the character content
A capital I enters edit mode.
After editing successfully, press the esc key, enter: wq! to save and exit
2. Modify /home/gitlab/data/gitlab-rails/etc/gitlab.yml, and change the value of host to the mapped host ip address and port, which will be displayed in the gitlab clone address
vi /home/gitlab/data/gitlab-rails/etc/gitlab.yml
/Web server settings Enter to find the character content
A capital I enters edit mode.
After editing successfully, press the esc key, enter: wq! to save and exit
7. Visit the GitLab page, enter your ip plus 8090
The first login needs to set the password of the default user root