使用Docker部署Gitlab

int32位 posted @ Mar 22, 2016 03:32:34 PM in docker , 1743 阅读
转载请注明:http://krystism.is-programmer.com/若有错误,请多多指正,谢谢!

1. 下载gitlab镜像

docker pull gitlab/gitlab-ce

2. 运行gitlab实例

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. 配置gitlab实例

3.1 配置邮箱:

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

下面以网易163邮箱为例配置邮箱:

gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.163.com"
gitlab_rails['smtp_port'] = 25
gitlab_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'] = false
gitlab_rails['smtp_openssl_verify_mode'] = "peer"

gitlab_rails['gitlab_email_from'] = "xxxx@163.com"
user["git_user_email"] = "xxxx@163.com"

注意以上的xxxx@163.com代表用户名,即邮箱地址,而xxxxpassword不是邮箱的登陆密码而是网易邮箱的客户端授权密码, 再网易邮箱web页面的设置-POP3/SMTP/IMAP-客户端授权密码查看。

3.2 配置外部访问URL

这个必须配置,否则默认以容器的主机名作为URL,刚开始由于做了端口映射80->8080, 因此设置为

external_url "http://10.103.240.36:8080"

后来发现external_url只能配置ip或者域名,不能有端口,否则不能启动。 于是只能把端口设置为80->80,然后external_url设置为:

external_url "http://10.103.240.36"

4. 重启gitlab

docker restart gitlab

 

转载请注明:http://krystism.is-programmer.com/若有错误,请多多指正,谢谢!
  • 无匹配
  • 无匹配
JNV Result 2022 说:
2021年11月17日 15:09

The Navodaya Entrance Exam Result 2022 or JNVST Result 2022 for Jawahar Navodaya Vidyalayas will be published on the Navodaya Vidyalaya Samiti website. JNV Result 2022 Students who took the 6th Class entrance exam can verify their details and download their results through the Navodaya class 6 admission official web portal.

Emma 说:
2023年1月23日 19:58

Deploying Gitlab using Docker is a great way to quickly and efficiently set up your source control system. With a few simple steps, you can have your Gitlab instance up buy cheap diamond rings and running in no time. First, pull the Gitlab image using Docker's 'docker pull gitlab/gitlab-ce' command. Then, run the Gitlab instance using Docker. With this easy process, you'll have your source control up and running in no time.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter