Error response from daemon: Get https://192.168.103.180/v2/: dial tcp 192.168.103.180:443: getsockop

执行docker login登录私有仓库时报错Error response from daemon: Get https://192.168.103.180/v2/: dial tcp 192.168.103.180:443: getsockopt: connection refused如下图:

我的这个Habor服务是192.168.103.59,想推镜像但登录失败了,解决办法如下:

修改当前登录的这台机器的/etc/docker/daemon.json,把这个Habor地址加进去,修改后如下:

Error response from daemon: Get https://192.168.103.180/v2/: dial tcp 192.168.103.180:443: getsockop_第1张图片

修改后重启docker:

systemctl daemon-reload

systemctl restart docker.service   即可成功!

另外,也有可能你的harbor服务自定义了端口,但是push的时候只写了Ip,就会报这个错!,端口加上即可push成功:

Error response from daemon: Get https://192.168.103.180/v2/: dial tcp 192.168.103.180:443: getsockop_第2张图片

拉镜像也一样:

Error response from daemon: Get https://192.168.103.180/v2/: dial tcp 192.168.103.180:443: getsockop_第3张图片

这次还遇到另外两个报错:Error response from daemon: Get https://192.168.103.180/v2/: dial tcp 192.168.103.180:443: connect: connection refused ,解决办法跟上面一样。

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

解决办法按https://lan6193.blog.csdn.net/article/details/105483772中的修改配置的步骤来即可解决,切勿漏掉一些操作(如自定义了端口也可移步这里完美解决)!

 

你可能感兴趣的:(Error response from daemon: Get https://192.168.103.180/v2/: dial tcp 192.168.103.180:443: getsockop)