1.docker pull gitlab/gitlab-ce
2. [root@localhost gitlab_docker]# cat docker-compose.yml
version: '3.8'
services:
gitlab:
image: 'gitlab/gitlab-ce:latest'
restart: always
container_name: 'gitlab'
environment:
TZ: 'Asia/Shanghai'
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://192.168.30.106:8939'
gitlab_rails['gitlab_shell_ssh_port'] = 2222
ports:
- '8939:8939'
- '2222:22'
volumes:
- './config:/etc/gitlab'
- './logs:/var/log/gitlab'
- './data:/var/opt/gitlab'
3.docker-compose up -d 这一步需要等待很久的时间
4.docker-compose restart
5.进入docker容器。
[root@localhost ~]# docker exec -it gitlab bash
root@ac86b46feb5b:/#
6.查看原始密码。root@ac86b46feb5b:/# cat /etc/gitlab/initial_root_password
7.登入 http://192.168.30.106:8939/修改原始密码
8.Gitlab默认的仓库存储路径在 /var/opt/gitlab/git-data目录下,仓库存储在子目录repositories里面