docker私有仓库使用

给镜像打标

查看目前本地有的镜像

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
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容