✨这里是第七人格的博客✨小七,欢迎您的到来~✨
系列专栏:【开发工程师的运维小知识】
✈️本篇内容: docker安装gitlab✈️
本篇收录完整代码地址:无
docker search gitlab/gitlab-ce
docker pull gitlab/gitlab-ce
日志目录
mkdir -p /mydata/gitlib/logs/
配置目录
mkdir -p /mydata/gitlib/config/
数据目录
mkdir -p /mydata/gitlib/data/
docker run -d -p 443:443 -p 8081:8081 -p 222:22 --name gitlab --restart always -v /mydata/gitlib/config:/etc/gitlab -v /mydata/gitlib/logs:/var/log/gitlab -v /mydata/gitlib/data:/var/opt/gitlab gitlab/gitlab-ce
docker ps | grep gitlab
vim /mydata/gitlib/config/gitlab.rb
增加以下代码
# 配置http协议所使用的访问地址,不加端口号默认为80
external_url 'http://192.168.75.3:8081'
gitlab_rails['gitlab_ssh_host'] = '192.168.75.3:8081'
gitlab_rails['gitlab_shell_ssh_port'] = 222
docker restart gitlab
cat /mydata/gitlib/config/initial_root_password
docker exec -it gitlab /bin/bash
gitlab-rails console
u=User.find(1)
u.password='seven12345678'
u.password_confirmation='seven12345678'
u.save!
exit
exit