利用 Docker 快速搭建 git 倉庫 Gitlab 與程式碼審閱 Gerrit 平臺
大多數程式猿都用過全球最大的git託管平臺Github,上面有豐富的開源專案。在Github上託管開源專案是免費的,但是私有專案需要收取管理費。對於擁有云伺服器的開發者或者團隊,可以使用本文介紹的Gitlab平臺。 話不多說,我們來看看具體的步驟。
系統環境:騰訊雲伺服器,配置1核心2G記憶體,系統Centos7.2
Step1:初始化伺服器環境
1、設定系統Swap。根據gitlab官方的介紹,硬體建議使用雙核4G記憶體的配置。本文主要介紹安裝和配置方法,選用的是單核2G記憶體的機器,為了提高系統的響應,設定2G大小的Swap。設定過程簡略,參考連線 https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-centos-6 設定完成後執行,可以看到swap設定成功。
<pre class="prism-token token language-javascript" style="box-sizing: border-box; list-style: inherit; margin: 24px 0px; font-style: normal; font-variant: normal; font-weight: 400; font-stretch: normal; font-size: 14px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(247, 247, 247); border-radius: 3px; word-wrap: normal; text-align: left; white-space: pre; word-spacing: 0px; word-break: normal; tab-size: 2; hyphens: none; color: rgb(51, 51, 51); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">[root@VM_26_11_centos ~]# free -m
total used free shared buff/cache available
Mem: 1840 88 83 8 1668 1589
Swap: 2047 0 2047
</pre>
2、安裝Nginx 為了使所有流量走80埠,本文使用Nginx做反向代理。 Nginx在Centos官方的源中是沒有這個軟體包的,需要執行
<pre class="prism-token token language-javascript" style="box-sizing: border-box; list-style: inherit; margin: 24px 0px; font-style: normal; font-variant: normal; font-weight: 400; font-stretch: normal; font-size: 14px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(247, 247, 247); border-radius: 3px; word-wrap: normal; text-align: left; white-space: pre; word-spacing: 0px; word-break: normal; tab-size: 2; hyphens: none; color: rgb(51, 51, 51); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">yum install epel-release
</pre>
新增EPEL源,騰訊雲的Centos上已經包含了EPEL源,直接執行
<pre class="prism-token token language-javascript" style="box-sizing: border-box; list-style: inherit; margin: 24px 0px; font-style: normal; font-variant: normal; font-weight: 400; font-stretch: normal; font-size: 14px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(247, 247, 247); border-radius: 3px; word-wrap: normal; text-align: left; white-space: pre; word-spacing: 0px; word-break: normal; tab-size: 2; hyphens: none; color: rgb(51, 51, 51); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">[root@VM_26_11_centos ~]# yum install nginx
</pre>
即可安裝 這裡需要注意的是騰訊雲在雲伺服器的控制檯這裡配置了安全組策略,預設的linux安全策略組沒有開啟80埠,需要手動新增80埠的規則。
<figure style="box-sizing: border-box; list-style: inherit; margin: 20px 0px; display: block; text-align: center; color: rgb(51, 51, 51); font-family: PingFangSC-Light, "hiragino sans gb", "helvetica neue", "microsoft yahei ui", "microsoft yahei", simsun, arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">
</figure>
2、安裝docker centos7安裝docker非常方便,直接執行
<pre class="prism-token token language-javascript" style="box-sizing: border-box; list-style: inherit; margin: 24px 0px; font-style: normal; font-variant: normal; font-weight: 400; font-stretch: normal; font-size: 14px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(247, 247, 247); border-radius: 3px; word-wrap: normal; text-align: left; white-space: pre; word-spacing: 0px; word-break: normal; tab-size: 2; hyphens: none; color: rgb(51, 51, 51); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">[root@VM_26_11_centos ~]# yum install docker -y
</pre>
3、啟動docker
<pre class="prism-token token language-javascript" style="box-sizing: border-box; list-style: inherit; margin: 24px 0px; font-style: normal; font-variant: normal; font-weight: 400; font-stretch: normal; font-size: 14px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(247, 247, 247); border-radius: 3px; word-wrap: normal; text-align: left; white-space: pre; word-spacing: 0px; word-break: normal; tab-size: 2; hyphens: none; color: rgb(51, 51, 51); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">[root@VM_26_11_centos ~]# systemctl start docker.service
[root@VM_26_11_centos ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
</pre>
目前docker服務還沒有任何容器 4、更新docker映象源 由於docker的映象伺服器在國外,直接拉取映象的時候速度非常慢。有很多國內的docker映象,本文以daocloud.io為例,在daocloud註冊後,會得到一個更新映象源的命令:
<pre class="prism-token token language-javascript" style="box-sizing: border-box; list-style: inherit; margin: 24px 0px; font-style: normal; font-variant: normal; font-weight: 400; font-stretch: normal; font-size: 14px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(247, 247, 247); border-radius: 3px; word-wrap: normal; text-align: left; white-space: pre; word-spacing: 0px; word-break: normal; tab-size: 2; hyphens: none; color: rgb(51, 51, 51); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">[root@VM_26_11_centos ~]# curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://b3d8b7d9.m.daocloud.io
docker version >= 1.12
{"registry-mirrors": ["http://b3d8b7d9.m.daocloud.io"],
"live-restore": true
}
Success.
You need to restart docker to take effect: sudo systemctl restart docker
[root@VM_26_11_centos ~]# systemctl restart docker
</pre>
到這裡就已經初始化好了執行的環境
Step2:安裝Gitlab
1、映象選擇 Gitlab官方在DockerHub上有映象,一些第三方開發者也上傳了自己的Gitlab映象,通過執行搜尋命令可以看到可用的docker映象:
<pre class="prism-token token language-javascript" style="box-sizing: border-box; list-style: inherit; margin: 24px 0px; font-style: normal; font-variant: normal; font-weight: 400; font-stretch: normal; font-size: 14px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(247, 247, 247); border-radius: 3px; word-wrap: normal; text-align: left; white-space: pre; word-spacing: 0px; word-break: normal; tab-size: 2; hyphens: none; color: rgb(51, 51, 51); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">[root@VM_26_11_centos ~]# docker search gitlab
INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED
docker.io docker.io/gitlab/gitlab-ce GitLab Community Edition docker image base... 1105 [OK]
docker.io docker.io/sameersbn/gitlab Dockerized gitlab web server 873 [OK]
docker.io docker.io/gitlab/gitlab-runner 177 [OK]
docker.io docker.io/gitlab/gitlab-ee GitLab Enterprise Edition docker image bas... 57
docker.io docker.io/twang2218/gitlab-ce-zh 這是漢化的 GitLab 社群版 Docker Image 30 [OK]
docker.io docker.io/anapsix/gitlab-ci GitLab-CI Continuous Integration in Docker... 28 [OK]
docker.io docker.io/centurylink/gitlab This image uses the image from sameersbn /... 24 [OK]
docker.io docker.io/genezys/gitlab Dockerized GitLab using the official omnib... 15 [OK]
</pre>
我們可以根據自己的喜好選擇docker映象。本文使用的是一個sameersbn/gitlab的映象(有關這個映象的詳細說明參考 https://github.com/sameersbn/docker-gitlab) 2、拉取映象 根據映象的說明,還需要使用資料庫和Redis,也可使用Docker映象,如https://github.com/sameersbn/docker-gitlab 中介紹的docker映象。本文使用的是已建好的Mysql和Redis資源,
<pre class="prism-token token language-javascript" style="box-sizing: border-box; list-style: inherit; margin: 24px 0px; font-style: normal; font-variant: normal; font-weight: 400; font-stretch: normal; font-size: 14px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(247, 247, 247); border-radius: 3px; word-wrap: normal; text-align: left; white-space: pre; word-spacing: 0px; word-break: normal; tab-size: 2; hyphens: none; color: rgb(51, 51, 51); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">[root@VM_26_11_centos ~]# docker pull docker.io/sameersbn/gitlab
[root@VM_26_11_centos ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/sameersbn/gitlab latest c7cd44692430 30 hours ago 1.083 GB
</pre>
由於我們之前設定了docker映象源,拉取映象的過程只需要兩分鐘就完成了。 3、建立容器
<pre class="prism-token token language-javascript" style="box-sizing: border-box; list-style: inherit; margin: 24px 0px; font-style: normal; font-variant: normal; font-weight: 400; font-stretch: normal; font-size: 14px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(247, 247, 247); border-radius: 3px; word-wrap: normal; text-align: left; white-space: pre; word-spacing: 0px; word-break: normal; tab-size: 2; hyphens: none; color: rgb(51, 51, 51); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">[root@VM_26_11_centos ~]# docker run --name gitlab -d
-p 127.0.0.1:10443:443 -p 127.0.0.1:10022:22 -p 127.0.0.1:10080:80
--env 'REDIS_HOST=redis.fin.red' --env 'REDIS_PORT=6379'
--env 'DB_ADAPTER=mysql2' --env 'DB_HOST=mysql.fin.red'
--env 'DB_NAME=gitlabhq_production_demo'
--env 'DB_USER=root' --env 'DB_PASS=2017123456' --env 'DB_PORT=3306'
--env 'GITLAB_HOST=gitlab.fin.red' --env 'GITLAB_ROOT_EMAIL=709729863@qq.com'
--env 'GITLAB_SECRETS_DB_KEY_BASE=long-and-random-alpha-numeric-string'
--env 'GITLAB_SECRETS_SECRET_KEY_BASE=long-and-random-alpha-numeric-string'
--env 'GITLAB_SECRETS_OTP_KEY_BASE=long-and-random-alpha-numeric-string'
--env 'GITLAB_MAX_OBJECT_SIZE=125829120'
--volume /var/www/Docker/gitlab:/home/git/data
docker.io/sameersbn/gitlab
</pre>
檢查容器執行情況
<pre class="prism-token token language-javascript" style="box-sizing: border-box; list-style: inherit; margin: 24px 0px; font-style: normal; font-variant: normal; font-weight: 400; font-stretch: normal; font-size: 14px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(247, 247, 247); border-radius: 3px; word-wrap: normal; text-align: left; white-space: pre; word-spacing: 0px; word-break: normal; tab-size: 2; hyphens: none; color: rgb(51, 51, 51); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">[root@VM_26_11_centos ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8e6bca607900 docker.io/sameersbn/gitlab "/sbin/entrypoint.sh " 51 seconds ago Up 50 seconds 0.0.0.0:10022->22/tcp, 0.0.0.0:10080->80/tcp, 0.0.0.0:10443->443/tcp gitlab
[root@VM_26_11_centos ~]# netstat -nptl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:10443 0.0.0.0:* LISTEN 5378/docker-proxy-c
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 24029/nginx: master
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 700/sshd
tcp 0 0 127.0.0.1:10080 0.0.0.0:* LISTEN 5385/docker-proxy-c
tcp 0 0 127.0.0.1:10022 0.0.0.0:* LISTEN 5392/docker-proxy-c
tcp6 0 0 :::22 :::* LISTEN 700/sshd
</pre>
說明gitlab的docker容器已經正常執行起來了。
Step3:安裝Gerrit
1、映象選擇 類似Gitlab,先搜尋gerrit映象
<pre class="prism-token token language-javascript" style="box-sizing: border-box; list-style: inherit; margin: 24px 0px; font-style: normal; font-variant: normal; font-weight: 400; font-stretch: normal; font-size: 14px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(247, 247, 247); border-radius: 3px; word-wrap: normal; text-align: left; white-space: pre; word-spacing: 0px; word-break: normal; tab-size: 2; hyphens: none; color: rgb(51, 51, 51); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">[root@VM_26_11_centos ~]# docker search gerrit
INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED
docker.io docker.io/openfrontier/gerrit The Gerrit docker support PostgreSQL MySQL... 45 [OK]
docker.io docker.io/larrycai/gerrit The Gerrit code review system based on ubuntu 17 [OK]
docker.io docker.io/gerritforge/gerrit-centos7 Gerrit Code Review on CentOS 7 13
docker.io docker.io/gerritforge/gerrit-ubuntu15.04 Gerrit Code Review on Ubuntu 15.04 12
docker.io docker.io/accenture/adop-gerrit ADOP Gerrit 5 [OK]
docker.io docker.io/fabric8/gerrit 5 [OK]
</pre>
Gerrit官方沒有提供映象,本文選擇openfrontier/gerrit映象
<pre class="prism-token token language-javascript" style="box-sizing: border-box; list-style: inherit; margin: 24px 0px; font-style: normal; font-variant: normal; font-weight: 400; font-stretch: normal; font-size: 14px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(247, 247, 247); border-radius: 3px; word-wrap: normal; text-align: left; white-space: pre; word-spacing: 0px; word-break: normal; tab-size: 2; hyphens: none; color: rgb(51, 51, 51); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">[root@VM_26_11_centos ~]# docker pull docker.io/openfrontier/gerrit
</pre>
2、建立容器 本文采用github的Oauth登入方式,需要在Github先註冊一個Oauth賬號,註冊內容如下
<figure style="box-sizing: border-box; list-style: inherit; margin: 20px 0px; display: block; text-align: center; color: rgb(51, 51, 51); font-family: PingFangSC-Light, "hiragino sans gb", "helvetica neue", "microsoft yahei ui", "microsoft yahei", simsun, arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">
</figure>
<pre class="prism-token token language-javascript" style="box-sizing: border-box; list-style: inherit; margin: 24px 0px; font-style: normal; font-variant: normal; font-weight: 400; font-stretch: normal; font-size: 14px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(247, 247, 247); border-radius: 3px; word-wrap: normal; text-align: left; white-space: pre; word-spacing: 0px; word-break: normal; tab-size: 2; hyphens: none; color: rgb(51, 51, 51); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">[root@VM_26_11_centos ~]# docker run
--name gerrit
-p 127.0.0.1:9418:8080
-p 127.0.0.1:19418:29418
-e WEBURL=http://gerrit.fin.red
-e USER_NAME=gerrit
-e USER_EMAIL=709729863@qq.com
-e AUTH_TYPE=OAUTH
-e OAUTH_ALLOW_EDIT_FULL_NAME=true
-e OAUTH_ALLOW_REGISTER_NEW_EMAIL=true
-e OAUTH_GITHUB_CLIENT_ID=4c70bd6eb7c87395ea69
-e OAUTH_GITHUB_CLIENT_SECRET=1bb740e97d47d4b5af0b842702beaf818c6b980a
-v /var/www/Docker/gerrit:/var/gerrit/review_site
-d docker.io/openfrontier/gerrit
[root@VM_26_11_centos ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0f261556de08 openfrontier/gerrit "/gerrit-entrypoint.s" 5 minutes ago Up 5 minutes 127.0.0.1:9418->8080/tcp, 127.0.0.1:19418->29418/tcp gerrit
75b4f71615a2 docker.io/sameersbn/gitlab "/sbin/entrypoint.sh " 9 days ago Up 2 minutes 127.0.0.1:10022->22/tcp, 127.0.0.1:10080->80/tcp, 127.0.0.1:10443->443/tcp gitlab
[root@VM_26_11_centos ~]# netstat -nptl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:9418 0.0.0.0:* LISTEN 2752/docker-proxy-c
tcp 0 0 127.0.0.1:10443 0.0.0.0:* LISTEN 3230/docker-proxy-c
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 3204/nginx: master
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 699/sshd
tcp 0 0 127.0.0.1:19418 0.0.0.0:* LISTEN 2745/docker-proxy-c
tcp 0 0 127.0.0.1:10080 0.0.0.0:* LISTEN 3237/docker-proxy-c
tcp 0 0 127.0.0.1:10022 0.0.0.0:* LISTEN 3244/docker-proxy-c
tcp6 0 0 :::22 :::* LISTEN 699/sshd
</pre>
說明gerrit的容器已經正常執行起來了
Step4:Gerrit與Gitlab配置及使用
由於我們的伺服器安全組只開了80埠,而Gerrit與Gitlab都不是工作在80埠,因此考慮使用Nginx做反向代理。 Nginx的反向代理很簡單,在/etc/nginx/conf.d/目錄下新建
<pre class="prism-token token language-javascript" style="box-sizing: border-box; list-style: inherit; margin: 24px 0px; font-style: normal; font-variant: normal; font-weight: 400; font-stretch: normal; font-size: 14px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(247, 247, 247); border-radius: 3px; word-wrap: normal; text-align: left; white-space: pre; word-spacing: 0px; word-break: normal; tab-size: 2; hyphens: none; color: rgb(51, 51, 51); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">[root@VM_26_11_centos ~]# cd /etc/nginx/conf.d/
[root@VM_26_11_centos conf.d]# vi virtual.conf
</pre>
輸入以下內容並儲存
<pre class="prism-token token language-javascript" style="box-sizing: border-box; list-style: inherit; margin: 24px 0px; font-style: normal; font-variant: normal; font-weight: 400; font-stretch: normal; font-size: 14px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(247, 247, 247); border-radius: 3px; word-wrap: normal; text-align: left; white-space: pre; word-spacing: 0px; word-break: normal; tab-size: 2; hyphens: none; color: rgb(51, 51, 51); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">#gitlab server
server
{
listen 80;
server_name gitlab.fin.red;
location / {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://0.0.0.0:10080;
}
}
gerrit server
server
{
listen 80;
server_name gerrit.fin.red;
location / {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://0.0.0.0:9418;
}
}
</pre>
測試配置檔案有無錯誤並給ngixn傳送reload指令
<pre class="prism-token token language-javascript" style="box-sizing: border-box; list-style: inherit; margin: 24px 0px; font-style: normal; font-variant: normal; font-weight: 400; font-stretch: normal; font-size: 14px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(247, 247, 247); border-radius: 3px; word-wrap: normal; text-align: left; white-space: pre; word-spacing: 0px; word-break: normal; tab-size: 2; hyphens: none; color: rgb(51, 51, 51); letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">[root@VM_26_11_centos conf.d]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[root@VM_26_11_centos conf.d]# nginx -s reload
</pre>
在瀏覽器中分別輸入 gitlab.fin.red以及gerrit.fin.red
<figure style="box-sizing: border-box; list-style: inherit; margin: 20px 0px; display: block; text-align: center; color: rgb(51, 51, 51); font-family: PingFangSC-Light, "hiragino sans gb", "helvetica neue", "microsoft yahei ui", "microsoft yahei", simsun, arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">
</figure>
<figure style="box-sizing: border-box; list-style: inherit; margin: 20px 0px; display: block; text-align: center; color: rgb(51, 51, 51); font-family: PingFangSC-Light, "hiragino sans gb", "helvetica neue", "microsoft yahei ui", "microsoft yahei", simsun, arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">
</figure>
到這裡就完成了Gitlab與Gerrit的安裝安裝
相關文章
- 《Git團隊協作》之Docker快速搭建GitLab私有倉庫DockerGitlab
- Docker 5分鐘搭建GitLab程式碼倉庫DockerGitlab
- git倉庫之gitlab搭建使用Gitlab
- docker搭建私人git倉庫DockerGit
- 在centos7搭建git程式碼倉庫CentOSGit
- gitlab私有倉庫搭建Gitlab
- 基於Docker快速搭建Gitlab與Gitlab CI/CD服務DockerGitlab
- Windows搭建SourceTree、Git程式碼管理平臺WindowsGit
- 使用docker快速搭建gitlab私服DockerGitlab
- 使用SourceTree管理GitLab程式碼倉庫Gitlab
- Git學習——遷移單一倉庫至其他程式碼託管平臺Git
- Docker倉庫之Registry私有映象倉庫的搭建與使用Docker
- docker搭建私有倉庫Docker
- docker 私有倉庫搭建Docker
- Git上fork後的程式碼倉庫如何與原倉庫進行同步Git
- Linux構建Git程式碼倉庫與自動部署LinuxGit
- git 同步fork的倉庫程式碼Git
- 【Harbor學習筆記】-教你快速搭建Docker私有倉庫筆記Docker
- 搭建安卓原始碼伺服器,repo+gerrit+git環境,程式碼稽核安卓原始碼伺服器Git
- Docker倉庫之Harbor企業級映象倉庫的搭建與使用Docker
- Docker搭建Harbor私有倉庫Docker
- Docker入門-搭建docker私有倉庫Docker
- 引入gitlab倉庫程式碼到npm包的教程GitlabNPM
- 利用docker快速搭建hexo部落格DockerHexo
- 如何配置極狐GitLab Docker 容器映象倉庫GitlabDocker
- docker gitlab搭建DockerGitlab
- Gerrit的用法及與gitlab的區別Gitlab
- git倉庫與專案原始碼分離Git原始碼
- Dockerfile指令與Docker-compose容器編排-搭建docker私有倉庫Docker
- Git提交程式碼倉庫的兩種方式Git
- Git 倉庫程式碼遷移步驟記錄Git
- 程式設計師都在學的docker--搭建harbor私有倉庫與管理程式設計師Docker
- 幾大Git平臺倉庫被劫 黑客欲勒索比特幣Git黑客比特幣
- 【工具使用】【Shell指令碼】【gitlab】下拉所有的倉庫以及每個倉庫的所有分支程式碼指令碼Gitlab
- 一臺電腦配置兩個Git賬號(github和gitlab),不同倉庫使用不同的gitGithubGitlab
- 用Docker搭建cnpm私有倉庫以及私有倉庫的使用DockerNPM
- 使用 docker + verdaccio 搭建npm私有倉庫DockerNPM
- docker使用容器搭建本地私有倉庫Docker