How to quickly deploy Gitlab using Docker

How to quickly deploy Gitlab using Docker

1. Download the gitlab image

docker pull gitlab/gitlab-ce

2. Run the gitlab instance

GITLAB_HOME=`pwd`/data/gitlab
docker run -d \
  --hostname gitlab \
  --publish 8443:443 --publish 80:80 --publish 2222:22 \
  --name gitlab \
  --restart always \
  --volume $GITLAB_HOME/config:/etc/gitlab \
  --volume $GITLAB_HOME/logs:/var/log/gitlab \
  --volume $GITLAB_HOME/data:/var/opt/gitlab \
  gitlab/gitlab-ce

3. Configure the gitlab instance

3.1 Configure Email:

docker exec -t -i gitlab vim /etc/gitlab/gitlab.rb

The following configuration of the mailbox takes NetEase 163 mailbox as an example:

gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.163.com"
gitlab_rails['smtp_port'] = 25
gitlab_rails['smtp_user_name'] = "[email protected]"
gitlab_rails['smtp_password'] = "xxxxpassword"
gitlab_rails['smtp_domain'] = "163.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = false
gitlab_rails['smtp_openssl_verify_mode'] = "peer"

gitlab_rails['gitlab_email_from'] = "[email protected]"
user["git_user_email"] = "[email protected]"

Please note that the [email protected] above represents the user name, that is, the email address, and xxxxpassword is not the login password of the email address but the client authorization password of NetEase email. You can check it in Settings - POP3/SMTP/IMAP - Client Authorization Password on the NetEase email web page.

3.2 Configuring external access URL

This must be configured, otherwise the default URL is the container's host name. At the beginning, because the port mapping 80->8080 was done, it was set to

external_url http://10.103.240.36:8080

Later I found that external_url can only be configured with IP or domain name, not port, otherwise it cannot be started.

So we can only set the port to 80->80, and then set external_url to:

external_url http://10.103.240.36

4. Restart gitlab

docker restart gitlab

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Detailed deployment of docker+gitlab+gitlab-runner
  • Docker-compose one-click deployment of gitlab Chinese version method steps
  • How to deploy gitlab using Docker-compose
  • How to install Gitlab with Docker
  • Detailed explanation of using docker to build gitlab
  • Teach you the detailed process of using Docker to build the Chinese version of gitlab community

<<:  Example of how to quickly delete a 2T table in mysql in Innodb

>>:  Element's el-tree multiple-select tree (checkbox) parent-child node association is not associated

Recommend

A brief discussion on the VUE uni-app development environment

Table of contents 1. Through HBuilderX visual int...

How to customize at and cron scheduled tasks in Linux

There are two types of scheduled tasks in Linux s...

Detailed explanation of Vuex environment

Table of contents Build Vuex environment Summariz...

Vue uses dynamic components to achieve TAB switching effect

Table of contents Problem Description What is Vue...

How to use vue filter

Table of contents Overview Defining filters Use o...

Linux Check the installation location of the software simple method

1. Check the software installation path: There is...

Use a diagram to explain what Web2.0 is

Nowadays we often talk about Web2.0, so what is W...

Our thoughts on the UI engineer career

I have been depressed for a long time, why? Some t...

How to open port 8080 on Alibaba Cloud ECS server

For security reasons, Alibaba Cloud Server ECS co...

MySQL database Load Data multiple uses

Table of contents Multiple uses of MySQL Load Dat...

Detailed explanation of the execution principle of MySQL kill command

Table of contents Kill instruction execution prin...

Detailed explanation of VUE Token's invalidation process

Table of contents Target Thought Analysis Code la...

Example verification MySQL | update field with the same value will record binlog

1. Introduction A few days ago, a development col...

Detailed tutorial on installing Docker on CentOS 8.4

Table of contents Preface: System Requirements: I...

Detailed explanation of WeChat Mini Program official face verification

The mini program collected user personal informat...