Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to install gitlab server in docker

Shulou Source: shulou.com Published: 2022-06-02 10:48:28 10月05日 Update

Today, I will talk to you about how to install gitlab server in docker. Many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.

1. Use docker to pull the code and execute the following command

Docker run-- name='gitlab'-d\

-p 1443-restart always 443-p 8088-- 8088

-- volume / root/docker/gitlab/config:/etc/gitlab\

-- volume / root/docker/gitlab/logs:/var/log/gitlab\

-- volume / root/docker/gitlab/data:/var/opt/gitlab/\

Gitlab/gitlab-ce

The mapped port can be modified, but it is best not to change the mapping of configuration, log and data, otherwise it will not be accessible after startup. After startup, you can use docker logs-f container name / id to view the startup log.

2. Then configure the gitlab.rb file in the / root/docker/gitlab/config directory. Here is my configuration

# configure the access address used by the http protocol

External_url "http://10.10.2.43:8088"

# # configuring access addresses and ports used by ssh protocol

Gitlab_rails ['gitlab_ssh_host'] = "http://10.10.2.43:8088"

Gitlab_rails ['gitlab_shell_ssh_port'] = 10022

# # Mailbox server configuration

Gitlab_rails ['smtp_enable'] = true

Gitlab_rails ['smtp_address'] = "smtp.exmail.qq.com" / / Mail server sending address

Gitlab_rails ['smtp_port'] = 25

Gitlab_rails ['smtp_user_name'] = "xxx@xxxx.com" / / the sender name is the same as the mailbox

Gitlab_rails ['smtp_password'] = "*" / / password

Gitlab_rails ['smtp_domain'] = "exmail.qq.com"

Gitlab_rails ['smtp_authentication'] =: login

Gitlab_rails ['smtp_enable_starttls_auto'] = true

Gitlab_rails ['gitlab_email_from'] = "xxx@xxxx.com" / / email address

3. Use the dockr restart gitlab command to restart the container after the above configuration, and the first visit will allow you to change your password. You can enter your native ip+ port to access it.

The above is the process of using docker to build gitlab in the local area network, but there is a problem after the successful construction. There is no problem in using http protocol to access the remote repository when pulling / submitting the code, but using ssh to access will report an error, as shown in the figure below.

After reading the above, do you have any further understanding of how to install gitlab server in docker? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Tags: Configuration server service address content port problem code command container password log mail mailbox success warehouse sender name local area local area network Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno NVidia Shulou Tech Info MySQL Redmi