docker搭建GitLab

  • 拉取镜像
docker pull store/gitlab/gitlab-ce:11.10.4-ce.0
  • 打标签
docker tag docker:store/gitlab/gitlab-ce:11.10.4-ce.0 docker:ce
  • 打容器
docker run 
  --detach 
  --hostname 192.168.1.102 //本地ip
  --publish 1111:1111  //访问端口
  --publish 1122:22  //ssh端口
  --name gitlab 
  --restart always 
  gitlab:ce

此时访问http://192.168.1.102:1111是打不开的 还需配置:

  • 修改配置文件
docker exec -it [id] bash
vi /etc/gitlab/gitlab.rb
  • 修改external_url属性为
external_url "http://192.168.0.102:1111"
  • 修改gitlab_shell_ssh_port为
gitlab_rails['gitlab_shell_ssh_port'] = 1122
  • 保存 退出
  • 重启gitlab容器
docker restart [id]
  • sucess

posted @ 2019-09-27 18:49  抽象工作室upup  阅读(492)  评论(0编辑  收藏  举报