使用Docker部署Gitlab

int32位 posted @ Mar 22, 2016 03:32:34 PM in docker , 1816 阅读
转载请注明: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.

things to do 说:
2023年8月31日 20:34

Known as the home of Yue opera, one of the most prominent forms of Chinese opera, there are many other things to do in Zhejiang. Zhejiang is an eastern coastal province of the People's Republic of China. Its capital and largest city is Hangzhou, and other notable cities include Ningbo and Wenzhou. Zhejiang is bordered by Jiangsu and Shanghai to the north, Anhui to the northwest, Jiangxi to the west and Fujian to the south. To the east is the East China Sea, beyond which lies the Ryukyu Islands. The population of Zhejiang stands at 64.6 million, the 8th highest among China. It has been called "the backbone of China" because it is a major driving force in the Chinese economy and being the birthplace of several notable people, including the Chinese Nationalist leader Chiang Kai-shek and entrepreneur Jack Ma. Zhejiang consists of 90 counties. The area of Zhejiang was controlled by the Kingdom of Yue during the Spring and Autumn period. The Qin Empire later annexed it in 222 BC. Under the late Ming dynasty and the Qing dynasty that followed it, Zhejiang's ports became important centers of international trade. It was occupied by the Empire of Japan during the Second Sino-Japanese war and placed under the control of the Japanese puppet state known as the Reorganized National Government of China. After Japan's defeat, Zhejiang's economy became stagnant under Mao Zedong's policies. Nevertheless, after China's economic reform, Zhejiang has grown to be considered one of China's wealthiest provinces, ranking fourth in GDP nationally and sixth by GDP per capita, with a nominal GDP of US$1.14 trillion as of 2022. Zhejiang consists mostly of hills, which account for about 70% of its total area, with higher altitudes towards the south and the west. Zhejiang also has a longer coastline than any other mainland province of China. The Qiantang River runs through the province, from which it derives its name. Included in the province are three thousand islands, the most in China. The capital Hangzhou marks the end of the Grand Canal and lies on Hangzhou Bay on the north of Zhejiang, which separates Shanghai and Ningbo. The bay contains many small islands collectively called the Zhoushan Islands. Hangzhou is a historically important city of China and is considered a World City with a "Beta+" classification according to GaWC. It includes the notable West Lake. Various varieties of Chinese are spoken in Zhejiang, the most prominent being Wu Chinese. Zhejiang is also one of China's leading provinces in research and education. As of 2022, two major cities in Zhejiang ranked in the world's top 200 cities (Hangzhou 19th and Ningbo 170th) by scientific research output, as tracked by Nature Index.


登录 *


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