# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/registry latest 136c8b16df20 4 weeks ago 33.17 MB
默认情况下,会将仓库存放于容器内的/tmp/registry目录下,这样如果容器被删除,则存放于容器中的镜像也会丢失,所以我们一般情况下会通过-v参数,指定本地一个目录挂载到容器内的/tmp/registry下,
2.pull/push镜像
把129上的某个镜像tag下,然后试试能否push到128的registry容器中,后面要跟:latest
#docker tag dreambroken/hello-world:latest 192.168.174.128:5000/hello:latest
使用push命令把重新打过tag的镜像上传到本地镜像仓库
# docker push 192.168.174.128:5000/hello:latest
The push refers to a repository [192.168.174.128:5000/hello]
unable to ping registry endpoint https://192.168.174.128:5000/v0/
v2 ping attempt failed with error: Get https://192.168.174.128:5000/v2/: http: server gave HTTP response to HTTPS client
v1 ping attempt failed with error: Get https://192.168.174.128:5000/v1/_ping: http: server gave HTTP response to HTTPS client
发现报错了,使用的是https,修改/etc/sysconfig/docker(这是centOS7下的1.10.3docker)文件,加上
ADD_REGISTRY='--add-registry 192.168.174.128:5000'
INSECURE_REGISTRY='--insecure-registry 192.168.174.128:5000'
重启docker服务
#systemctl restart docker
然后push成功
#docker push 192.168.174.128:5000/hello:latest
The push refers to a repository [192.168.174.128:5000/hello]
a02596fdd012: Pushed
latest: digest: sha256:0256e8a36e2070f7bf2d0b0763dbabdd67798512411de4cdcf9431a1feb60fd9 size: 502