Dokcer建立私人倉庫、私人倉庫Web管理

來源:互聯網
上載者:User

標籤:registry   style   color   倉庫   

1、直接用Docker提供的鏡像registry運行私人倉庫

#  docker run -d -p 5000:5000 -v /data/registry:/var/lib/registry --name registry --restart=‘always‘ registry

-d : 後台運行

-p : 宿主機跟容器映射連接埠   SERVER_PORT:CONTAINER_PORT

-v : 掛載宿主機目錄到容器中作為資料卷, docker registry上傳鏡像預設存放到容器/var/lib/registry,將本地/data/registry目錄掛載到容器中,避免刪除容器是資料丟失

--name : 容器名稱,不配置將隨機產生

--restart: 重啟策略,這裡配置為always為任何時候

 

2、查看倉庫是否正常

# curl http://192.168.62.200:5000/v2/{}

 

# curl -XGET http://192.168.62.200:5000/v2/_catalog{"repositories":["saltruler_web","ubuntu"]}

 

3、查看本地images

# docker imagesREPOSITORY                          TAG                 IMAGE ID            CREATED             SIZEsaltops                             v3                  f86ee612af8f        20 minutes ago      580 MBsaltops                             v2                  f851c8406430        5 hours ago         580 MBsaltops                             latest              b8246781274a        6 hours ago         509 MBcentos/resin                        3.1.8               24b506c6b19a        4 days ago          450 MB192.168.62.200:5000/saltruler_web   latest              a2e9e9205aea        4 days ago          966 MBsaltruler_web                       latest              a2e9e9205aea        4 days ago          966 MBdjangotest_web                      latest              3c00ad940197        5 days ago          722 MBmysql                               latest              9546ca122d3a        11 days ago         407 MBpython                              3.4                 c588c14f484e        2 weeks ago         684 MBpython                              2.7                 68caceba17ab        2 weeks ago         677 MBpostgres                            latest              9910dc9f2ac0        2 weeks ago         267 MBcentos                              latest              98d35105a391        3 weeks ago         192 MBmycentos                            latest              98d35105a391        3 weeks ago         192 MBjdeathe/centos-ssh-apache-php       latest              c2ae3c97feb1        4 weeks ago         284 MBregistry                            2                   047218491f8c        5 weeks ago         33.2 MBregistry                            latest              047218491f8c        5 weeks ago         33.2 MBredis                               latest              e4a35914679d        5 weeks ago         183 MBnginx                               latest              6b914bbcb89e        5 weeks ago         182 MBregistry                            2.1.1               52bb991b482e        17 months ago       220 MB

 

4、標記上傳的鏡像

# docker tag saltops:v3 192.168.62.200:5000/saltops:v3# docker imagesREPOSITORY                          TAG                 IMAGE ID            CREATED             SIZE192.168.62.200:5000/saltops         v3                  f86ee612af8f        22 minutes ago      580 MBsaltops                             v3                  f86ee612af8f        22 minutes ago      580 MBsaltops                             v2                  f851c8406430        5 hours ago         580 MBsaltops                             latest              b8246781274a        6 hours ago         509 MBcentos/resin                        3.1.8               24b506c6b19a        4 days ago          450 MB192.168.62.200:5000/saltruler_web   latest              a2e9e9205aea        4 days ago          966 MBsaltruler_web                       latest              a2e9e9205aea        4 days ago          966 MBdjangotest_web                      latest              3c00ad940197        5 days ago          722 MBmysql                               latest              9546ca122d3a        11 days ago         407 MBpython                              3.4                 c588c14f484e        2 weeks ago         684 MBpython                              2.7                 68caceba17ab        2 weeks ago         677 MBpostgres                            latest              9910dc9f2ac0        2 weeks ago         267 MBmycentos                            latest              98d35105a391        3 weeks ago         192 MBcentos                              latest              98d35105a391        3 weeks ago         192 MBjdeathe/centos-ssh-apache-php       latest              c2ae3c97feb1        4 weeks ago         284 MBregistry                            2                   047218491f8c        5 weeks ago         33.2 MBregistry                            latest              047218491f8c        5 weeks ago         33.2 MBredis                               latest              e4a35914679d        5 weeks ago         183 MBnginx                               latest              6b914bbcb89e        5 weeks ago         182 MBregistry                            2.1.1               52bb991b482e        17 months ago       220 MB

 

5、push上傳到私人倉庫

# docker push 192.168.62.200:5000/saltops:v3The push refers to a repository [192.168.62.200:5000/saltops]d8d7b4725725: Pushed 81e97be478f1: Pushed f245be9edb71: Pushed 9b198ff9ff5b: Pushed v3: digest: sha256:4a7c610dbeab40a25486b6d8eb7b98bc95c585d1c3fc1f99c34a06348eea0c19 size: 1162

 

6、查看剛剛上傳到私人倉庫的saltops

# curl -XGET http://192.168.62.200:5000/v2/saltops/tags/list{"name":"saltops","tags":["v3"]}

 

 

7、部署私人倉庫管理UI,

小蝸牛收集以下三種Docker Registry 管理 UI,Breezes親測使用

I、Breezes :  Breezes 是一個多中心和多版本的 Docker Registry 管理 UI,

II、docker-registry-web

III、docker-registry-frontend

 

I、Breezes部署

安裝Breezes

git clone https://git.oschina.net/kbsonlong/Breezes.gitcd Breezes/yum install -y gcc gcc-c++ python-devel pip install -r requirements.txt -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

 

啟動Breezes

# sh Control.shBreezes start over.# netstat -ntlp|grep Breezestcp        0      0 0.0.0.0:10210           0.0.0.0:*               LISTEN      33787/Breezes       tcp6       0      0 :::10210                :::*                    LISTEN      33787/Breezes

 

http://192.168.62.200:10210/ui/

650) this.width=650;" style="background-image: none; border-right- 0px; padding-left: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M02/8F/C8/wKioL1jsnZ3ysiNcAAF4V8_p_ss612.png" width="1812" height="456" />

 

添加私人倉庫

650) this.width=650;" style="background-image: none; border-right- 0px; padding-left: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M01/8F/C9/wKiom1jsnZ2TT-m8AAD_ooB7vlQ065.png" width="842" height="926" />

 

查看鏡像

650) this.width=650;" style="background-image: none; border-right- 0px; padding-left: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://s3.51cto.com/wyfs02/M01/8F/C8/wKioL1jsnZ7S_4vCAAIQcK41B6A920.png" width="1812" height="656" />

 

 

docker run -d --name saltops -v /data/saltops:/data/saltops -p 8002:8001 -p 80:8000 saltops:v2 python3 /data/saltops/manage.py runserver 0.0.0.0:8001

Dokcer建立私人倉庫、私人倉庫Web管理

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.