docker-compose安装gitlab-ce

创建docker-compose文件

version: '3'
services:
  gitlab:
    image: gitlab/gitlab-ce:rc
    container_name: gitlabce
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'http://192.168.1.105:49153' #本机IP:容器端口 有域名写域名
        gitlab_rails['gitlab_shell_ssh_port'] = 2223 #次gitlab容器内部ssh
    ports:
      - 49153:49153
      - 2223:22
    volumes:
      #配置映射
      - ./config:/etc/gitlab
      #日志映射
      - ./logs:/var/log/gitlab
      #数据映射
      - ./data:/var/opt/gitlab
	restart: always

创建挂载卷所需文件夹

sudo mkdir -p ./config ./logs ./data

运行

sudo docker-compose -f docker-compose.yaml up -d

查看初始密码

/etc/gitlab/initial_root_password 文件中

sudo more ./config/initial_root_password

结果

docker-compose安装gitlab-ce_第1张图片

你可能感兴趣的:(git,git)