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

Introduction to fork in multithreading under Linux

Table of contents Question: Case (1) fork before ...

CSS naming conventions (rules) worth collecting Commonly used CSS naming rules

CSS naming conventions (rules) Commonly used CSS ...

Implementation of k8s node rejoining the master cluster

1. Delete node Execute kubectl delete node node01...

Detailed explanation of MySQL database isolation level and MVCC

Table of contents 1. Isolation Level READ UNCOMMI...

Why MySQL does not recommend deleting data

Table of contents Preface InnoDB storage architec...

Two ways to make IE6 display PNG-24 format images normally

Method 1: Please add the following code after <...

How to deal with garbled characters in Mysql database

In MySQL, database garbled characters can general...

MySQL 8.0.19 installation and configuration tutorial under Windows 10

I will be learning MySQL next semester. I didn...

Installation tutorial of MySQL 5.1 and 5.7 under Linux

The operating system for the following content is...

Docker realizes the connection with the same IP network segment

Recently, I solved the problem of Docker and the ...

More popular and creative dark background web design examples

Dark background style page design is very popular...

How to implement the paging function of MyBatis interceptor

How to implement the paging function of MyBatis i...

MySQL database table and database partitioning strategy

First, let's talk about why we need to divide...