Centos7-docker runs gitlab

Centos7-docker runs gitlab

1. Prepare the configuration file gitlab.rb in the /gitlab/config folder

external_url 'https://gitlab.xxx.cn'
nginx['enable'] = true
nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.xxx.cn.crt"
nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.xxx.cn.key"

2. Execute the docker command to configure the startup container

#!/bin/bash
docker stop gitlab
docker rm gitlab
docker run --detach \
    --hostname gitlab.xxx.cn \
    --publish 5555:80 -p 5556:443 -p 5557:22 \
    --name gitlab \
    --volume /gitlab/config:/etc/gitlab \
    --volume /gitlab/logs:/var/log/gitlab \
    --volume /gitlab/data:/var/opt/gitlab \
    gitlab/gitlab-ce:latest

3. If you have opened port 5556, you can access it, or configure https proxy for nginx.

server {
    listen 443 ssl;
    server_name gitlab.xxx.cn;
    location / {
        # /etc/hosts file has pointed the domain name to the local
        proxy_pass https://gitlab.xxx.cn:5556;
    }
    charset utf-8;
    ssl_certificate /https/xxx.cn.key.pem;
    ssl_certificate_key /https/xxx.cn.key;
    ssl_dhparam /https/dhparam.pem;
    ssl_session_timeout 1d;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets on;
    ssl_protocols SSLv2 SSLv3 TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128:AES256:AES:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK;
}

Note: docker restart gitlab will cause gitlab to fail to start. The only way to do this is to re-execute the top script every time you restart. As long as the data directory generated for the first time does not move, you can continue to use it. Oops

Reprinted at: https://www.jianshu.com/p/8ee6bb402814

Intelligent Recommendation

Docker runs the systemctl command in centos7

How can I run the systemctl command in docker? After many pits, I finally found a way. First of all, systemctl is the real root privileges of the system when the docker container is running. That is, ...

Docker creates and runs CENTOS7 container

Docker creates and runs CENTOS7 container First ensure this host (or VMware virtual machine) environment is CentOS7-X86_64 environment, Docker has installed Compared to ARM64, PPC64LE version installa...

Docker runs gitlab to report permission error "2770"

  * bash[Set proper security context on ssh files for selinux] action run (skipped due to only_if) Recipe: gitlab::gitlab-rails   * storage_directory[/var/opt/gitlab/git-data] action create ...

2020-11-04 Docker runs gitlab Accessible

Mapping Docker 8090 port This needs and configuration files corresponding to gitlab.yml I mileped configuration file directory: /mnt/gitlab/data/gitlab-rails/etc/gitlab.yml I am a card here for a long...

Under centos7, docker installs gitlab

Docker install gitlab First of all: install gitlab, it is recommended to use at least 4GB of available memory, will install redis, nginx and other components by default The first step is to pull the g...

More Recommendation

Centos7 deploys GitLab using docker

1 Introduction In this Nanjing business trip, SVN was used to manage the version of the code. Since SVN is a centralized version management tool, it is impossible to check the version log without the ...

gitLab and docker build process on the centos7

yum install docker centos comes yum, can be installed directly by docker yum, directly related dependencies will be pulled down yum list installed | grep docker we can look after completing follow hav...

How to install gitlab in docker on centos7

  yum installation preparation The following two are to permanently enable the firewall and add http services yum install gitlab-ce If an error is reported, use the following command:   2. I...

Centos7 Docker build gitlab (persistence)

Centos7 Docker build gitlab (persistence) 1- Install docker and configure acceleration, otherwise the speed will be very slow Install Docker 2- Download the gitlab mirror 3- Create persistent storage ...

"Centos7-docker install gitlab+jenkins"

table of Contents docker install gitlab+jenkins 1. Turn off the firewall 2. Install docker 3. Start docker Gitlab operation 1. Import gitlab image 2. Create the container gitlab 3. Log in to the web p...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top