给镜像打标
查看目前本地有的镜像
docker images
返回
REPOSITORY TAG IMAGE ID CREATED SIZE
centos latest 640922cd37e6 4 hours ago 418MB
image_flyfish latest dcd36c0edaf9 21 hours ago 5.78GB
centos initial eeb6ee3f44bd 20 months ago 204MB
打标
docker tag centos:latest 10.10.20.201:5000/centos:basic
再次查看镜像
docker images
返回
REPOSITORY TAG IMAGE ID CREATED SIZE
10.10.20.201:5000/centos basic 640922cd37e6 4 hours ago 418MB
centos latest 640922cd37e6 4 hours ago 418MB
image_flyfish latest dcd36c0edaf9 21 hours ago 5.78GB
centos initial eeb6ee3f44bd 20 months ago 204MB
已经打标完成
推送仓库
docker push 10.10.20.201:5000/centos:basic
返回
The push refers to repository [10.10.20.201:5000/centos]
1209b1785caa: Pushed
174f56854903: Pushed
basic: digest: sha256:452b84286178a417f9d9c638027bdc55565a8b2dc70557f2eea1203a39961410 size: 741
列出私有仓库的镜像
curl http://10.10.20.201:5000/v2/_catalog
返回
{"repositories":["centos"]}
查看镜像名称下所有标签
curl http://10.10.20.201:5000/v2/centos/tags/list
返回
{"name":"centos","tags":["basic"]}
拉取镜像
docker pull 10.10.20.201:5000/centos:basic