1.下载镜像
docker pull beginor/gitlab-ce:11.0.1-ce.0
2.创建三个文件夹
mkdir -p /mnt/gitlab/etc
mkdir -p /mnt/gitlab/log
mkdir -p /mnt/gitlab/data
3.启动容器
docker run \
--detach \
--publish 8443:443 \
--publish 8090:80 \
--name gitlab \
--restart unless-stopped \
-v /mnt/gitlab/etc:/etc/gitlab \
-v /mnt/gitlab/log:/var/log/gitlab \
-v /mnt/gitlab/data:/var/opt/gitlab \
beginor/gitlab-ce:11.0.1-ce.0
4.修改vi /mnt/gitlab/etc/gitlab.rb
external_url 'http://127.0.0.1'
5.修改vi /mnt/gitlab/data/gitlab-rails/etc/gitlab.yml
#
# 1. GitLab app settings
# ==========================
## GitLab settings
gitlab:
## Web server settings (note: host is the FQDN, do not include http://)
host: 127.0.0.1
port: 8090
https: false
6.访问 localhost:8090