1. 创建docker-compose.yml文件

version: '3'
services:
  gitlab:
    image: 'gitlab/gitlab-ce'
    restart: always
    container_name: gitlab
    hostname: gitlab
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'http://ip' # http协议所使用的访问地址,ip是本机ip地址,默认80端口
        gitlab_rails['gitlab_shell_ssh_port']=2234 # 此端口是run时22端口映射的2224端口
        unicorn['port']=9011 
        unicorn['listen']='127.0.0.1'
    privileged: true
    ports:
      - 8929:80
      - 2235:2234
    volumes:
      - ./config:/etc/gitlab
      - ./logs:/var/log/gitlab
      - ./data:/var/opt/gitlab

2. 运行 docker-compose up -d 启动gitlab,浏览器访问 http://ip:8929 即可

相关文章:

  • 2022-02-18
  • 2021-11-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-16
  • 2021-07-17
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-04
  • 2021-07-06
  • 2021-12-31
  • 2021-07-07
  • 2021-09-23
相关资源
相似解决方案