[root@test01 ~]# docker push 192.168.1.30:5000/centosThe push refers to a repository [192.168.1.30:5000/centos]Get https://192.168.1.30:5000/v1/_ping: http: server gave HTTP response to HTTPS client
[root@test01 ~]# docker imagesREPOSITORY TAG IMAGE ID CREATED SIZEdocker.io/wordpress latest 346b1443b020 30 hours ago 407 MB[root@test01 ~]# docker push 192.168.1.30:5000/wordpressThe push refers to a repository [192.168.1.30:5000/wordpress]An image does not exist locally with the tag: 192.168.1.30:5000/wordpress[root@test01 ~]#
根据提示,我们知道需要修改一下tag才能上传
[root@test01 ~]# docker tag docker.io/wordpress 192.168.1.30:5000/wordpress[root@test01 ~]# docker imagesREPOSITORY TAG IMAGE ID CREATED SIZE192.168.1.30:5000/wordpress latest 346b1443b020 30 hours ago 407 MBdocker.io/wordpress latest 346b1443b020 30 hours ago 407 MB[root@test01 ~]# docker push 192.168.1.30:5000/wordpressThe push refers to a repository [192.168.1.30:5000/wordpress]3d7c1bb6ce9f: Pushed
加入ADD_REGISTRY='--add-registry 192.168.1.30:5000'[root@test01 ~]# cat /etc/sysconfig/docker# /etc/sysconfig/docker# Modify these options if you want to change the way the docker daemon runsOPTIONS='--selinux-enabled --log-driver=journald --signature-verification=false -H unix:///var/run/docker.sock -H 0.0.0.0:2376'ADD_REGISTRY='--add-registry 192.168.1.30:5000'if [ -z "${DOCKER_CERT_PATH}" ]; then DOCKER_CERT_PATH=/etc/dockerfi