Error response from daemon: Get https://10.0.2.15:5000/v2/: http: server gave HTTP response to HTTPS client

在之前的步骤上https://blog.csdn.net/lyc0424/article/details/103247051把127.0.0.1修改为宿主机的IP地址10.0.2.15发现不能push镜像到本地registry了(docker push 10.0.2.15:5000/lyc666/httpd:v1),报了上面这个错误。已有镜像tag为10.0.2.15:5000/lyc666/httpd:v1

然后上网查资料,参考https://github.com/docker/distribution/issues/1874

  1. 创建或修改/etc/docker/daemon.json
    { "insecure-registries":["myregistry.example.com:5000"] }
  2. 重新启动docker daemon
    sudo service docker restart

Error response from daemon: Get https://10.0.2.15:5000/v2/: http: server gave HTTP response to HTTPS

再次push镜像时,又报了另一个错误Get https://10.0.2.15:5000/v2/: dial tcp 10.0.2.15:5000: connect: connection refused

参考这篇博客https://www.cnblogs.com/lkun/p/7990466.html解决,注意其中的ip指的是你的宿主机的IP,要记得改!

Error response from daemon: Get https://10.0.2.15:5000/v2/: http: server gave HTTP response to HTTPS

Error response from daemon: Get https://10.0.2.15:5000/v2/: http: server gave HTTP response to HTTPS

 

 

相关文章: