docker login harbor出现的报错Error response from daemon: Get https://172.16.1.99/v1/users/: dial tcp 172.16.1.99:443: getsockopt: connection refused解决方法

·  阅读 2730
原文链接: www.cnblogs.com
?
出现的问题   [root@master01 ~]# docker login 172.16.1.99 Username: admin Password: Error response from daemon: Get https://172.16.1.99/v1/users/ : dial tcp 172.16.1.99:443: getsockopt: connection refused

  

?
docker 连接harbor客户端的版本   [root@master01 docker]# docker version Client:  Version:      17.03.2-ce  API version:  1.27  Go version:   go1.7.5  Git commit:   f5ec1e2  Built:        Tue Jun 27 01:35:00 2017  OS/Arch:      linux /amd64   Server:  Version:      17.03.2-ce  API version:  1.27 (minimum version 1.12)  Go version:   go1.7.5  Git commit:   f5ec1e2  Built:        Tue Jun 27 01:35:00 2017  OS/Arch:      linux /amd64  Experimental: false

  

?
查找docker.service 所在的位置   [root@master01 docker]# find / -name docker.service -type f /etc/systemd/system/docker.service

  

?
修改配置文件, 增加  --insecure-registry=172.16.1.99 选项     [root@master01 docker]# cat /etc/systemd/system/docker.service [Unit] Description=Docker Application Container Engine Documentation=http://docs.docker.io   [Service] Environment="PATH=/opt/kube/bin:/bin:/sbin:/usr/bin:/usr/sbin" ExecStart=/opt/kube/bin/dockerd --insecure-registry=172.16.1.99 ExecStartPost=/sbin/iptables -I FORWARD -s 0.0.0.0/0 -j ACCEPT ExecReload=/bin/kill -s HUP $MAINPID Restart=on-failure RestartSec=5 LimitNOFILE=infinity LimitNPROC=infinity LimitCORE=infinity Delegate=yes KillMode=process   [Install] WantedBy=multi-user.target

  

?
重新启动服务   systemctl daemon-reload   systemctl restart docker

  

?
查看服务,已经包含了 --insecure-registry=172.16.1.99 参数   [root@master01 docker]# ps aux|grep docker root      6385  0.5  2.1 419248 39836 ?        Ssl  05:30   0:03 /opt/kube/bin/dockerd --insecure-registry=172.16.1.99 root      6398  0.0  0.5 292736  9884 ?        Ssl  05:30   0:00 docker-containerd -l unix: ///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --shim docker-containerd-shim --runtime docker-runc root      6544  0.0  0.1 266796  3560 ?        Sl   05:30   0:00 docker-containerd-shim d20f94482cdaca325518d5726a3e6859b5ed1a9a0a457e3bf1386c1df4951912 /var/run/docker/libcontainerd/d20f94482cdaca325518d5726a3e6859b5ed1a9a0a457e3bf1386c1df4951912 docker-runc root      6623  0.0  0.1 266796  3552 ?        Sl   05:30   0:00 docker-containerd-shim 29892d644f78137564d071a94a8ff4226bea25b95c7c4363e7cc3ccb280a6313 /var/run/docker/libcontainerd/29892d644f78137564d071a94a8ff4226bea25b95c7c4363e7cc3ccb280a6313 docker-runc root      8547  0.0  0.0 112704   972 pts/0    R+   05:40   0:00 grep --color=auto docker

  

?
再进行登录操作 , 可以成功登录   [root@master01 docker]# docker login 172.16.1.99 Username (admin): admin Password: Login Succeeded

  

 

分类:
阅读
标签:
分类:
阅读
标签:
收藏成功!
已添加到「」, 点击更改