1. docker pull gitlab/gitlab-ce
  1. docker run --detach \
  2. --publish 10443:443 --publish 1080:80 --publish 1022:22 \
  3. --name gitlab \
  4. --restart always \
  5. --volume /mydata/gitlab/config:/etc/gitlab \
  6. --volume /mydata/gitlab/logs:/var/log/gitlab \
  7. --volume /mydata/gitlab/data:/var/opt/gitlab \
  8. gitlab/gitlab-ce:latest
  1. # 开启1080端口
  2. firewall-cmd --zone=public --add-port=1080/tcp --permanent
  3. # 重启防火墙才能生效
  4. firewall-cmd --reload
  5. # 查看已经开放的端口
  6. firewall-cmd --list-ports
  1. docker logs gitlab -f
  1. docker exec -it gitlab grep 'Password:' /etc/gitlab/initial_root_password

安装完成解决gitlab克隆地址是一串英文代码

  1. find /mydata/gitlab/ -name gitlab.rb
  1. external_url 'http://192.168.213.128'
  1. docker restart gitlab