docker搭建gitlab

docker搭建gitlab

在服務器上直接安裝gitlab,會裝入Git,Redis ,postgresql,nginx等。如果主機已有redis、nginx等,配置會比較麻煩。而且以後gitlab的備份和遷移都不方便。附主機安裝教程:

https://about.gitlab.com/downloads/#centos7 
https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/12

如果將gitlab進行Docker化部署,所有服務如redis,postgresql等放在一個docker容器裏,將配置、數據等文件掛載在宿主機上,備份和遷移時候只要複製docker鏡像和掛載的數據目錄即可。

運行gitlab容器

#查找鏡像
[root@cloud ~]# docker search gitlab


INDEX       NAME                                               DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
docker.io   docker.io/gitlab/gitlab-ce                         GitLab Community Edition docker image base...   946                  [OK]
docker.io   docker.io/sameersbn/gitlab                         Dockerized gitlab web server                    803                  [OK]
docker.io   docker.io/gitlab/gitlab-runner                                                                     143                  [OK]
docker.io   docker.io/gitlab/gitlab-ee                         GitLab Enterprise Edition docker image bas...   47                   # 拉取鏡像
docker pull docker.io/gitlab/gitlab-ce

# 啓動鏡像(使用橋接網絡啓動docker)
docker run --detach \
    --publish 9443:443 --publish 9080:80 --publish 9022:22 \
    --name gitlab \
    --restart always \
  --volume /app/gitlab/config:/etc/gitlab \
--volume /app/gitlab/logs:/var/log/gitlab \
--volume /app/gitlab/data:/var/opt/gitlab gitlab/gitlab-ce

瀏覽器打開http://132.97.xxx.xxx:9080   即可訪問到gitlab

gitlab初始用戶名/密碼:

username: root

password: 5iveL!fe 


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章