1. 准备工作:
centos7
[root@dev_vonedao_95 gitlab]# docker -v Docker version 19.03.5, build 633a0ea [root@dev_vonedao_95 gitlab]# docker-compose -v docker-compose version 1.25.1-rc1, build d92e9bee
2.拉镜像
docker pull gitlab/gitlab-ce
3.修改ssh端口
vi /etc/ssh/sshd_config Port 60022
4.重启sshd服务
systemctl restart sshd
5.配置docker-compose文件
[root@dev_vonedao_95 gitlab]# cat docker-compose.yml web: image: 'gitlab/gitlab-ce:latest' restart: always hostname: 'gitlab.example.com' environment: TZ: 'Asia/Shanghai' GITLAB_OMNIBUS_CONFIG: | external_url 'https://192.168.2.95' gitlab_rails['time_zone'] = 'Asia/Shanghai' ports: - '8080:80' - '443:443' - '22:22' volumes: - '/dockerdata/gitlab/config:/etc/gitlab' - '/dockerdata/gitlab/logs:/var/log/gitlab' - '/dockerdata/gitlab/data:/var/opt/gitlab'
6.启动容器
[root@dev_vonedao_95 gitlab]# ls docker-compose.yml [root@dev_vonedao_95 gitlab]# docker-compose up -d
7.访问gitlab
https://192.168.2.95
8.设置密码
太简单的密码会报错
9.使用