基于docker搭建gitlab服务器
系统: ubuntu-18.04.3-live-server-amd64
今天想基于docker搭建一个gitlab服务器,以下步骤基于已有docker和docker-compose
找到一个docker image
找到一个合适的版本并下载
docker pull twang2218/gitlab-ce-zh:11.1
写一个docker compose
version: '3'
services:
gitlab:
image: 'twang2218/gitlab-ce-zh:11.1'
restart: always
hostname: '172.20.10.9'
environment:
TZ: 'Asia/Shanghai'
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://172.20.10.9'
gitlab_rails['time_zone'] = 'Asia/Shanghai'
gitlab_rails['gitlab_shell_ssh_port'] = 2222
ports:
- '80:80'
- '8443:443'
- '2222:22'
volumes:
- config:/etc/gitlab
- data:/var/opt/gitlab
- logs:/var/log/gitlab
volumes:
config:
data:
logs:
启动
docker-compose up -d
关闭
docker-compose down