Ubuntu docker 安装gitlab

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ubuntu docker 安装gitlab相关的知识,希望对你有一定的参考价值。

参考技术A 1、 mkdir -p /docker/gitlab/logs,config,data

2、

cat > /docker/gitlab/docker-compose.yml <<EOF

version: "3"

services:

  gitlab:

    image: gitlab/gitlab-ce

    container_name: gitlab

    restart: always

    hostname: 'localhost'

    environment:

      TZ: 'Asia/Shanghai'

      GITLAB_OMNIBUS_CONFIG: |

        external_url "http://localhost:9090"

        gitlab_rails['gitlab_shell_ssh_port'] = 2222

        gitlab_rails['gitlab_email_enabled'] = true

        gitlab_rails['gitlab_email_from'] = 'xxx@xxxxx.com'

        gitlab_rails['gitlab_email_display_name'] = 'xxx'

        gitlab_rails['gitlab_email_reply_to'] = 'xxxx@xxxxx.com'

        gitlab_rails['smtp_enable'] = true

        gitlab_rails['smtp_address'] = "smtp.mxhichina.com"

        gitlab_rails['smtp_port'] = 465

        gitlab_rails['smtp_user_name'] = "xxx@xxxx.com"

        gitlab_rails['smtp_password'] = "xxxxx"

        gitlab_rails['smtp_domain'] = "smtp.mxhichina.com"

        gitlab_rails['smtp_authentication'] = "login"

        gitlab_rails['smtp_enable_starttls_auto'] = true

        gitlab_rails['smtp_openssl_verify_mode'] = 'peer'

        gitlab_rails['smtp_tls'] = true

    ports:

      - '9090:9090'

      - '2222:22'

    networks:

      - cidi

    volumes:

      - '/docker/gitlab/config:/etc/gitlab'

      - '/docker/gitlab/logs:/var/log/gitlab'

      - '/docker/gitlab/data:/var/opt/gitlab'

    logging:

      driver: "json-file"

      options:

        max-size: "20m"

        max-file: "10"

networks:

  cidi:

    external: true

EOF

3、docker-compose up -d

以上是关于Ubuntu docker 安装gitlab的主要内容,如果未能解决你的问题,请参考以下文章

【Docker】Ubuntu 18.04 安装Docker

ubuntu16怎么安装docker

docker(大坑2):解决安装的ubuntu镜像无service命令

如何在ubuntu上安装docker

如何在ubuntu 32位安装docker

docker+ubuntu一键安装宝塔