SpringCloud(第055編)CentOS 7 docker-registryプライベートライブラリおよび管理インタフェースの構築


SpringCloud(第055編)CentOS 7 docker-registryプライベートライブラリおよび管理インタフェースの構築
-
一、大まかに紹介する
1、    docker   ,           ,         docker   ;
2、                         ui  ,      ,     portainer    ;
3、     portainer      ,        ,             :
    3.1 DockerUI      ,      ,      ;
    3.2 Shipyard     ,      ,      ,            ;
    3.3 Portainer      ,     ,      Shipyard  ,         ,      ;
    3.4 Daocloud     ,        ,        ,             ;
4、  :    my_host_ip    ,             ip    ;

二、docker-registry取付手順
2.1 docker-registryミラーの検索
//   docker    ,       registry     ,       
[root@svr01 ~]# docker search registry
INDEX       NAME                                              DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
docker.io   docker.io/registry                                The Docker Registry 2.0 implementation for...   1847      [OK]       
docker.io   docker.io/konradkleine/docker-registry-frontend   Browse and modify your Docker registry in ...   177                  [OK]
docker.io   docker.io/hyper/docker-registry-web               Web UI, authentication service and event r...   123                  [OK]
。。。。。。
docker.io   docker.io/convox/registry                                                                         0                    
docker.io   docker.io/kontena/registry                        Kontena Registry                                0                    
docker.io   docker.io/lorieri/registry-ceph                   Ceph Rados Gateway (and any other S3 compa...   0                    
docker.io   docker.io/mattford63/registry                     The officail docker-registry with python-m...   0  

2.2 docker.を引き出すio/registryミラー
//            ,       
[root@svr01 ~]# docker pull docker.io/registry:2.3.1
Trying to pull repository docker.io/library/registry ... 
2.3.1: Pulling from docker.io/library/registry
fdd5d7827f33: Pull complete 
a3ed95caeb02: Pull complete 
a79b4a92697e: Pull complete 
6cbb75c7cc30: Pull complete 
4831699594bc: Pull complete 
Digest: sha256:9bd58f43fdf3c378ee7f19ec6e355a5ecbfad8eab82c77079b974b5a78b59e4d
[root@svr01 ~]#
[root@svr01 ~]#
[root@svr01 ~]#
[root@svr01 ~]#
[root@svr01 ~]#

//          ,      ,         
[root@svr01 ~]# docker pull docker.io/registry
Using default tag: latest
Trying to pull repository docker.io/library/registry ... 
latest: Pulling from docker.io/library/registry
81033e7c1d6a: Pull complete 
b235084c2315: Pull complete 
c692f3a6894b: Pull complete 
ba2177f3a70e: Pull complete 
a8d793620947: Pull complete 
Digest: sha256:672d519d7fd7bbc7a448d17956ebeefe225d5eb27509d8dc5ce67ecb4a0bce54
[root@svr01 ~]#
[root@svr01 ~]#
[root@svr01 ~]#
[root@svr01 ~]#
[root@svr01 ~]#

//                    
[root@svr01 ~]# docker images
REPOSITORY                             TAG                 IMAGE ID            CREATED             SIZE
docker.io/registry                     latest              d1fd7d86a825        3 weeks ago         33.26 MB
springms/gateway-zuul                  latest              f3825f14878c        6 weeks ago         248.5 MB
springms/provider-user                 latest              5f8a95ffddae        6 weeks ago         270.6 MB
springms/discovery-eureka              latest              825e3f54be46        6 weeks ago         252.5 MB
springms-simple-provider-user          latest              7ccdcdd5270f        6 weeks ago         235.6 MB
springms-user                          latest              4799ed153086        6 weeks ago         235.6 MB
docker.io/centos                       v2                  11efb35f320c        6 weeks ago         307.5 MB
docker.io/frolvlad/alpine-oraclejdk8   latest              4f03dc990224        8 weeks ago         170.1 MB
frolvlad/alpine-oraclejdk8             slim                4f03dc990224        8 weeks ago         170.1 MB
docker.io/centos                       latest              3fa822599e10        8 weeks ago         203.5 MB
docker.io/hello-world                  latest              f2a91732366c        10 weeks ago        1.848 kB
docker.io/registry                     2.3.1               83139345d017        23 months ago       165.8 MB

2.3 docker-registryの起動
[root@svr01 ~]# docker run -d -p 5000:5000 --restart=always -v /tmp/docker-var/:/var/lib/registry registry:2.3.1

2.4構築されたミラーウェアハウスへのアクセス
//    curl     ,             
[root@svr01 ~]# curl http://my_host_ip:5000/v2
Moved Permanently.

//         http://my_host_ip:5000/v2     ,        {}         。

2.5テストミラーをミラーウェアハウスにアップロードする
//    tag  
[root@svr01 ~]# docker tag busybox my_host_ip:5000/busybox
[root@svr01 ~]# docker images
REPOSITORY                                        TAG                 IMAGE ID            CREATED             SIZE
my_host_ip:5000/busybox                       latest              5b0d59026729        7 days ago          1.146 MB
docker.io/busybox                                 latest              5b0d59026729        7 days ago          1.146 MB
docker.io/registry                                latest              d1fd7d86a825        3 weeks ago         33.26 MB
springms/gateway-zuul                             latest              f3825f14878c        6 weeks ago         248.5 MB
springms/provider-user                            latest              5f8a95ffddae        6 weeks ago         270.6 MB
springms/discovery-eureka                         latest              825e3f54be46        6 weeks ago         252.5 MB
springms-simple-provider-user                     latest              7ccdcdd5270f        6 weeks ago         235.6 MB
springms-user                                     latest              4799ed153086        6 weeks ago         235.6 MB
docker.io/centos                                  v2                  11efb35f320c        6 weeks ago         307.5 MB
docker.io/frolvlad/alpine-oraclejdk8              latest              4f03dc990224        8 weeks ago         170.1 MB
frolvlad/alpine-oraclejdk8                        slim                4f03dc990224        8 weeks ago         170.1 MB
docker.io/centos                                  latest              3fa822599e10        8 weeks ago         203.5 MB
docker.io/hello-world                             latest              f2a91732366c        10 weeks ago        1.848 kB
docker.io/registry                                2.3.1               83139345d017        23 months ago       165.8 MB
docker.io/konradkleine/docker-registry-frontend   latest              7621ed3504d4        23 months ago       234.9 MB

// push     
[root@svr01 ~]# docker push ip:5000/busybox
The push refers to a repository [my_host_ip:5000/busybox]
Get https://my_host_ip:5000/v1/_ping: http: server gave HTTP response to HTTPS client
[root@svr01 ~]# docker push my_host_ip:5000/busybox
The push refers to a repository [my_host_ip:5000/busybox]
Get https://my_host_ip:5000/v1/_ping: http: server gave HTTP response to HTTPS client

//        ,    /etc/docker/daemon.json   ,      
     :{"insecure-registries":["my_host_ip:5000"]}

//   docker
[root@svr01 ~]# service docker restart
Redirecting to /bin/systemctl restart  docker.service
[root@svr01 ~]# 

//     
[root@svr01 ~]# docker push my_host_ip:5000/busybox
The push refers to a repository [my_host_ip:5000/busybox]
4febd3792a1f: Pushed 
latest: digest: sha256:4cee1979ba0bf7db9fc5d28fb7b798ca69ae95a47c5fecf46327720df4ff352d size: 527
[root@svr01 ~]# 

2.6プッシュしたばかりのbusyboxファイルの表示
[root@svr01 ~]# curl http://my_host_ip:5000/v2/_catalog
{"repositories":["busybox"]}
[root@svr01 ~]# 

2.7アップロードしたばかりのミラーをダウンロードする
//          
[root@svr01 ~]# docker rmi my_host_ip:5000/busybox:latest
Untagged: my_host_ip:5000/busybox:latest
Untagged: my_host_ip:5000/busybox@sha256:4cee1979ba0bf7db9fc5d28fb7b798ca69ae95a47c5fecf46327720df4ff352d
[root@svr01 ~]# 

//     
[root@svr01 ~]# docker pull my_host_ip:5000/busybox
Using default tag: latest
Trying to pull repository my_host_ip:5000/busybox ... 
latest: Pulling from my_host_ip:5000/busybox
Digest: sha256:4cee1979ba0bf7db9fc5d28fb7b798ca69ae95a47c5fecf46327720df4ff352d

//     ,my_host_ip:5000/busybox          
[root@svr01 ~]# docker images
REPOSITORY                                        TAG                 IMAGE ID            CREATED             SIZE
docker.io/busybox                                 latest              5b0d59026729        7 days ago          1.146 MB
my_host_ip:5000/busybox                           latest              5b0d59026729        7 days ago          1.146 MB
docker.io/registry                                latest              d1fd7d86a825        3 weeks ago         33.26 MB
springms/gateway-zuul                             latest              f3825f14878c        6 weeks ago         248.5 MB
springms/provider-user                            latest              5f8a95ffddae        6 weeks ago         270.6 MB
springms/discovery-eureka                         latest              825e3f54be46        6 weeks ago         252.5 MB
springms-simple-provider-user                     latest              7ccdcdd5270f        6 weeks ago         235.6 MB
springms-user                                     latest              4799ed153086        6 weeks ago         235.6 MB
docker.io/centos                                  v2                  11efb35f320c        6 weeks ago         307.5 MB
frolvlad/alpine-oraclejdk8                        slim                4f03dc990224        8 weeks ago         170.1 MB
docker.io/frolvlad/alpine-oraclejdk8              latest              4f03dc990224        8 weeks ago         170.1 MB
docker.io/centos                                  latest              3fa822599e10        8 weeks ago         203.5 MB
docker.io/hello-world                             latest              f2a91732366c        10 weeks ago        1.848 kB
docker.io/registry                                2.3.1               83139345d017        23 months ago       165.8 MB
docker.io/konradkleine/docker-registry-frontend   latest              7621ed3504d4        23 months ago       234.9 MB
[root@svr01 ~]# 

三、portainer管理インタフェースのインストール
3.1軽量レベルの管理インタフェースのダウンロード
[root@svr01 ~]# docker pull docker.io/portainer/portainer
Using default tag: latest
Trying to pull repository docker.io/portainer/portainer ... 
latest: Pulling from docker.io/portainer/portainer
d1e017099d17: Pull complete 
d63e75e16ec8: Pull complete 
Digest: sha256:232742dcb04faeb109f1086241f290cb89ad4c0576e75197e902ca6e3bf3a9fc
[root@svr01 ~]# 

3.2 portainerの起動
[root@svr01 ~]# docker run -d -p 9000:9000 --restart=always -v /var/run/docker.sock:/var/run/docker.sock --name parainer-test docker.io/portainer/portainer

3.3管理インタフェースへのアクセス
      http://my_host_ip:9000/       UI    ;

四、ダウンロードアドレス
https://gitee.com/ylimhhmily/SpringCloudTutorial.git
SpringCloudTutorial交流QQ群:235322432
SpringCloudTutorial交流微信群:微信コミュニケーション群QRコードピクチャーリンク
注目を歓迎して、あなたのはきっと私に対する最大の支持です!!!