Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of rapidly deploying Gitlab using Docker

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

1. Download gitlab image

Docker pull gitlab/gitlab-ce

two。 Run the gitlab instance

GITLAB_HOME= `pwd` / data/gitlabdocker run-d\-- hostname gitlab\-- publish 8443 publish 80:80-- publish 2222 GITLAB_HOME/logs:/var/log/gitlab 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 gitlab instance

3.1 configure mailboxes:

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

Take NetEase 163mailbox as an example to configure mailbox:

Gitlab_rails ['smtp_enable'] = truegitlab_rails [' smtp_address'] = "smtp.163.com" gitlab_rails ['smtp_port'] = 25gitlab_rails [' smtp_user_name'] = "xxxx@163.com" gitlab_rails ['smtp_password'] = "xxxxpassword" gitlab_rails [' smtp_domain'] = "163.com" gitlab_rails ['smtp_authentication'] = "login" gitlab_rails [' smtp_enable_starttls_auto'] = falsegitlab _ rails ['smtp_openssl_verify_mode'] = "peer" gitlab_rails [' gitlab_email_from'] = "xxxx@163.com" user ["git_user_email"] = "xxxx@163.com"

Note that the above xxxx@163.com represents the user name, that is, the email address, while xxxxpassword is not the login password of the mailbox but the client authorization password of NetEase mailbox, and then NetEase mailbox web page settings-POP3/SMTP/IMAP- client authorization password view.

3.2 configure external access to URL

This must be configured, otherwise the hostname of the container is used as the URL by default. At first, because the port mapping is 80-> 8080, it is set to

External_url http://10.103.240.36:8080

Later, it was found that external_url can only be configured with ip or domain name, and cannot have ports, otherwise it cannot be started.

Therefore, the port can only be set to 80-> 80, and then external_url can be set to:

External_url http://10.103.240.36

4. Restart gitlab

Docker restart gitlab

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report