创建docker-compose.yml
version: '3.6'
services:
gitlab:
container_name: gitlab
image: 'gitlab/gitlab-ce'
hostname: '192.168.12.16'
restart: always
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://192.168.12.16'
ports:
- '80:80'
- '443:443'
- '22:22'
volumes:
- '/tmp/gitlab/conf:/etc/gitlab'
- '/tmp/gitlab/data:/var/opt/gitlab'
- '/tmp/gitlab/logs:/var/log/gitlab'
启动服务
docker-compose up -d --build

本文详细介绍如何使用docker-compose.yml文件配置并启动GitLab服务。通过设置容器名称、镜像、主机名、环境变量及端口映射等,实现GitLab在Linux环境下的顺利运行。
812

被折叠的 条评论
为什么被折叠?



