docker启动gitlab
添加名为GITLAB_HOME
的环境变量
创建docker-compose.yml
文件,内容如下
version: "3"
services:
web:
image: 'gitlab/gitlab-ce:14.0.7-ce.0'
restart: always
hostname: 'gitlab.example.com'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://gitlab.example.com:8929'
gitlab_rails['gitlab_shell_ssh_port'] = 2224
ports:
- '8929:8929'
- '2224:22'
volumes:
- '$GITLAB_HOME/config:/etc/gitlab'
- '$GITLAB_HOME/logs:/var/log/gitlab'
- '$GITLAB_HOME/data:/var/opt/gitlab'
在docker-compose.yml
文件所在目录下执行
docker-compose up -d
等待三分钟左右启动完成,访问http://localhost:8929/
会跳转到登录页面,但目前还不能注册登录
需要先进入容器,查看管理员root密码
docker exec -it 容器id bash
cat /etc/gitlab/initial_root_password
Reference
https://cloud.tencent.com/developer/article/1933338
发表回复