[root@localhost mydockerfile]# docker push 192.168.182.3:5000/xhh/myubuntu
Using default tag: latest
The push refers to repository [192.168.182.3:5000/xhh/myubuntu]
Get "https://192.168.182.3:5000/v2/": http: server gave HTTP response to HTTPS client
网上都是说,需要修改
/etc/docker/deamon.json添加insecure-registries设置,设置后还是未生效。
{
"registry-mirrors": [
"https://registry.docker-cn.com",
"http://hub-mirror.c.163.com",
"https://docker.mirrors.ustc.edu.cn"
],
"insecure-registries":[
"192.168.182.3:5000"
]
}
本质问题是,还需要修改vim /usr/lib/systemd/system/docker.service
ExecStart=/usr/bin/dockerd --insecure-registry 192.168.182.3:5000 -H fd:// --containerd=/run/containerd/containerd.sock
把ExecStart那行,添加--insecure-registry 192.168.182.3:5000 即可。
systemctl daemon-reload
systemctl restart docker
重启docker。