[root@h103 ~]# docker run -d -p 5000:5000 --restart=always --name registry registry:2
4352b16f2582ed0478f3380be5ab4a65487d7adf1698c66f365881e3aefdab68
[root@h103 ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4352b16f2582 registry:2 "/bin/registry /etc/d" 7 seconds ago Up 5 seconds 0.0.0.0:5000->5000/tcp registry
[root@h103 ~]# docker pull ubuntu && docker tag ubuntu localhost:5000/ubuntu
Using default tag: latest
Pulling repository docker.io/library/ubuntu
8693db7e8a00: Download complete
8693db7e8a00: Pulling image (latest) from docker.io/library/ubuntu
f15ce52fc004: Download complete
c4fae638e7ce: Download complete
Status: Image is up to date for ubuntu:latest
docker.io/library/ubuntu: this image was pulled from a legacy registry. Important: This registry version will not be supported in future versions of docker.
[root@h103 ~]# echo $?
0
[root@h103 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
localhost:5000/myfirstimage latest 8693db7e8a00 30 hours ago 187.9 MB
ubuntu latest 8693db7e8a00 30 hours ago 187.9 MB
localhost:5000/ubuntu latest 8693db7e8a00 30 hours ago 187.9 MB
jenkins latest fc39417bd5fb 12 days ago 708.1 MB
registry 2 683f9cd9cf88 2 weeks ago 224.5 MB
hello-world latest 0a6ba66e537a 3 months ago 960 B
[root@h103 ~]# docker push localhost:5000/ubuntu
The push refers to a repository [localhost:5000/ubuntu] (len: 1)
8693db7e8a00: Pushed
a4c5be5b6e59: Pushed
c4fae638e7ce: Pushed
f15ce52fc004: Pushed
latest: digest: sha256:45d78ef16a9e6199ffbbc78f71c2c6ef6647f3be6b9721fe3f1b08d6e3fcf6b3 size: 6800
[root@h103 ~]#
[root@h103 ~]# docker pull localhost:5000/ubuntu
Using default tag: latest
latest: Pulling from ubuntu
Digest: sha256:45d78ef16a9e6199ffbbc78f71c2c6ef6647f3be6b9721fe3f1b08d6e3fcf6b3
Status: Image is up to date for localhost:5000/ubuntu:latest
[root@h103 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
localhost:5000/myfirstimage latest 8693db7e8a00 31 hours ago 187.9 MB
ubuntu latest 8693db7e8a00 31 hours ago 187.9 MB
localhost:5000/ubuntu latest 8693db7e8a00 31 hours ago 187.9 MB
jenkins latest fc39417bd5fb 12 days ago 708.1 MB
registry 2 683f9cd9cf88 2 weeks ago 224.5 MB
hello-world latest 0a6ba66e537a 3 months ago 960 B
[root@h103 ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4352b16f2582 registry:2 "/bin/registry /etc/d" 28 minutes ago Up 28 minutes 0.0.0.0:5000->5000/tcp registry
[root@h103 ~]# docker stop registry && docker rm -v registry
registry
registry
[root@h103 ~]#
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。