使用Docker部署GitLab

預先準備docker 環境這裏不做介紹

獲取gitlib 鏡像

執行 docker pullgitlab/gitlab-ce

cloud@ubuntu14044:~$ docker pull gitlab/gitlab-ce
Using default tag: latest
latest: Pulling from gitlab/gitlab-ce

6599cadaf950: Pull complete 
23eda618d451: Pull complete 
f0be3084efe9: Pull complete 
52de432f084b: Pull complete 
a3ed95caeb02: Pull complete 
c7bdadca674f: Pull complete 
f77fd87d9501: Pull complete 
bf401969663c: Pull complete 
084dc13ccc83: Pull complete 
Digest: sha256:8c6ad3fdccf8e97a114af7622edbfa66b41ffe98b2abb7870fb4804192b77f14
Status: Downloaded newer image for gitlab/gitlab-ce:latest
cloud@ubuntu14044:~$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
gitlab/gitlab-ce    latest              98dfe52bcfd2        6 days ago          1.185 GB
<none>              <none>              da1376434ab5        3 weeks ago         320.4 MB
<none>              <none>              c698fd9ffe04        3 weeks ago         120.1 MB
ubuntu              latest              44776f55294a        3 weeks ago         120.1 MB
centos              latest              778a53015523        6 weeks ago         196.7 MB
hello-world         latest              690ed74de00f        7 months ago        960 B
cloud@ubuntu14044:~$ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

啓動gitlib容器  

執行 sudo docker run --detach --hostnamegitlab.example.com --publish 444:443 --publish 80:80 --publish 222:22 --namegitlab --restart always --volume /srv/gitlab/config:/etc/gitlab --volume/srv/gitlab/logs:/var/log/gitlab --volume /srv/gitlab/data:/var/opt/gitlabgitlab/gitlab-ce:latest

cloud@ubuntu14044:~$ sudo docker run --detach --hostname gitlab.example.com --publish 444:443 --publish 800:80 --publish 222:22 --name gitlab --restart always --volume /srv/gitlab/config:/etc/gitlab --volume /srv/gitlab/logs:/var/log/gitlab --volume /srv/gitlab/data:/var/opt/gitlab gitlab/gitlab-ce:latest
[sudo] password for cloud: 
344d8e23d32af42ac9e5abd7c86f0e35a1fb2ce2158ea65f8bafec54c479737a
cloud@ubuntu14044:~$ docker ps
CONTAINER ID        IMAGE                     COMMAND             CREATED             STATUS              PORTS                                                            NAMES
344d8e23d32a        gitlab/gitlab-ce:latest   "/assets/wrapper"   10 seconds ago      Up 6 seconds        0.0.0.0:222->22/tcp, 0.0.0.0:80->80/tcp, 0.0.0.0:444->443/tcp   gitlab
(如果在啓動容器是有端口占用的情況,可以修改轉發的端口,先刪除容器,再啓動一個,參考升級GitLab 版本的步驟 http://docs.gitlab.com/omnibus/docker/#after-starting-a-container )

訪問gitlib web

瀏覽器輸入 http://IP


參考鏈接

http://doc.gitlab.com/omnibus/docker/

http://doc.gitlab.com/omnibus/docker/#after-starting-a-container


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