Docker管理本地仓库

首先给镜像打上标签,很重要!!!
[root@docker ~]# docker tag fuchao:latest 127.0.0.1:5000/cangku_ceshi

docker tag 镜像:标签 ip:端口/自定义的name

上传到私有仓库
[root@docker ~]# docker push 127.0.0.1:5000/cangku_ceshi
The push refers to a repository [127.0.0.1:5000/cangku_ceshi] (len: 1)
Sending image list
Pushing repository 127.0.0.1:5000/cangku_ceshi (1 tags)
895b070402bd: Image successfully pushed
02e5bca4149b: Image successfully pushed
b2ae0a712b39: Image successfully pushed
af88597ec24b: Image successfully pushed
8be9f7652ab5: Image successfully pushed
Pushing tag for rev [8be9f7652ab5] on {http://127.0.0.1:5000/v1/repositories/cangku_ceshi/tags/latest}
[root@docker ~]#

从私有仓库下载

[root@docker ~]# docker pull 127.0.0.1:5000/cangku_ceshi
Using default tag: latest
8be9f7652ab5: Download complete
895b070402bd: Download complete
02e5bca4149b: Download complete
b2ae0a712b39: Download complete
af88597ec24b: Download complete
Status: Image is up to date for 127.0.0.1:5000/cangku_ceshi:latest

[root@docker ~]#

上面的不仅本机可以 别的电脑也可以。上传、下载。

你可能感兴趣的:(Docker管理本地仓库)