创建一个文件夹:/home/docker/gitlab
docker-compose.yml
version: '3.6'
services:
web:
image: 'gitlab/gitlab-ce:15.3.3-ce.0'
restart: always
hostname: 'gitlab.****.com.cn'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://gitlab.****.com.cn'
gitlab_rails['gitlab_shell_ssh_port'] = 9922
ports:
- '80:80'
- '443:443'
- '9922:22'
volumes:
- '/home/docker/gitlab/config:/etc/gitlab'
- '/home/docker/gitlab/logs:/var/log/gitlab'
- '/home/docker/gitlab/data:/var/opt/gitlab'
shm_size: '256m'
hostname: 'gitlab.****.com.cn'
为gitlab的ip或域名
external_url 'http://gitlab.****.com.cn'
为gitlab开放的ip或域名(要包含端口)
执行命令:
docker-compose up -d
等待镜像下载。。。。
获取初始用户root的密码
docker exec -it $(docker ps | grep gitlab | awk '{print $1}') grep 'Password:' /etc/gitlab/initial_root_password
访问地址:
http://10.3.23.193:9980
通过root账号登录成功
version: '3.6'
services:
web:
image: 'gitlab/gitlab-ce:15.3.3-ce.0'
restart: always
hostname: 'gitlab.bidr.com.cn'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'https://gitlab.bidr.com.cn'
gitlab_rails['gitlab_shell_ssh_port'] = 9922
ports:
- '80:80'
- '443:443'
- '9922:22'
volumes:
- '/home/docker/gitlab/config:/etc/gitlab'
- '/home/docker/gitlab/logs:/var/log/gitlab'
- '/home/docker/gitlab/data:/var/opt/gitlab'
shm_size: '256m'
网友评论