在Docker上安装GitLab


title: 在Docker上安装GitLab
date: 2020-03-21 10:29:51
categories: 微服务基础设施


在Docker上安装GitLab

拉取镜像

 docker pull twang2218/gitlab-ce-zh

安装

docker-compose.yml 配置如下:

version: '3'
services:
    web:
      image: 'twang2218/gitlab-ce-zh'
      restart: always
      hostname: '192.168.1.3'
      environment:
        TZ: 'Asia/Shanghai'
        GITLAB_OMNIBUS_CONFIG: |
          external_url 'http://192.168.1.3:8080'
          gitlab_rails['gitlab_shell_ssh_port'] = 2222
          unicorn['port'] = 8888
          nginx['listen_port'] = 8080
      ports:
        - '8080:8080'
        - '8443:443'
        - '2222:22'
      volumes:
        - /usr/local/docker/gitlab/config:/etc/gitlab
        - /usr/local/docker/gitlab/data:/var/opt/gitlab
        - /usr/local/docker/gitlab/logs:/var/log/gitlab

启动

docker-compose up

GitLab 使用SSH免密登录

生成 SSH KEY

E:\work\technology\tool\Git\usr\bin下输入命令

ssh-keygen -trsa -C "[email protected]"

然后将生成的公钥添加到代码托管平台即可

猜你喜欢

转载自blog.csdn.net/qq_42013035/article/details/105620892