docker-compose容器化gitlab
- docker-compose安装
c
# 官方链接(不推荐,太慢了)
curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
# 下面的官方链接会快一点
curl -L https://get.daocloud.io/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
# 修改文件权限
chmod +x /usr/local/bin/docker-compose
# 查看 docker-compose 版本
docker-compose --version
- docker-compose.yml文件
c
version: '3.6'
services:
web:
image: 'registry.gitlab.cn/omnibus/gitlab-jh:latest'
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'
shm_size: '256m'
- 初始密码
c
用户名root
/config/initial_root_password文件中
搭建成功!