Docker Registry3

2022-01-21 15:02:43 浏览数 (2)

推送镜像到Registry

代码语言:javascript复制
[root@h103 ~]# docker push localhost:5000/myfirstimage 
The push refers to a repository [localhost:5000/myfirstimage] (len: 1)
8693db7e8a00: Pushed 
a4c5be5b6e59: Pushed 
c4fae638e7ce: Pushed 
f15ce52fc004: Pushed 
latest: digest: sha256:a27637294694a32300c5a9b94c9078709ec75216dd875fbdbc89acb0eb803401 size: 6806
[root@h103 ~]# 

从Registry拉取镜像

代码语言:javascript复制
[root@h103 ~]# docker pull localhost:5000/myfirstimage
Using default tag: latest
latest: Pulling from myfirstimage
Digest: sha256:a27637294694a32300c5a9b94c9078709ec75216dd875fbdbc89acb0eb803401
Status: Image is up to date for localhost:5000/myfirstimage:latest
[root@h103 ~]# echo $?
0
[root@h103 ~]# 

销毁Registry

registry和其它实例没有任何区别,使用stop然后rm就可以便捷地进行销毁

代码语言:javascript复制
[root@h103 ~]# docker  ps -a 
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAME
7716d7899161        registry:2          "/bin/registry /etc/d"   22 hours ago        Up 2 minutes        0.0.0.0:5000->5000/tcp   regi
[root@h103 ~]# docker stop 7716d7899161
7716d7899161
[root@h103 ~]# docker  ps -a 
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                     PORTS               NA
7716d7899161        registry:2          "/bin/registry /etc/d"   22 hours ago        Exited (2) 1 seconds ago                       re
[root@h103 ~]# docker rm 7716d7899161
7716d7899161
[root@h103 ~]# docker  ps -a 
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
[root@h103 ~]# 

0 人点赞