返回

提问 添加收藏

Docker 本地镜像仓库Harbor推送上传报错getsockopt: connection refused

静坐的时光丶 发布于 2018年12月04日 (共有3个回帖)

[root@rancher-agent ~]# docker push 192.168.0.190:9090/spring_cloud/eurekaserver:v1.0.0
The push refers to a repository [192.168.0.190:9090/spring_cloud/eurekaserver]
Put http://192.168.0.190:9090/v1/repositories/spring_cloud/eurekaserver/: dial tcp 192.168.0.190:9090: getsockopt: connection refused
[root@rancher-agent ~]# 

环境:

Harbor版本是V1.2.2

Harbor服务器登录地址是192.168.0.190 ,端口默认80

Harbor服务器Centos7.5 系统已经关闭防火墙

推送命令是

docker tag SOURCE_IMAGE[:TAG] 192.168.0.190:9090/spring_cloud/IMAGE[:TAG]
docker push 192.168.0.190:9090/spring_cloud/IMAGE[:TAG]

docker 版本

[root@rancher-agent ~]# docker version
Client:
 Version:         1.13.1
 API version:     1.26
 Package version: docker-1.13.1-75.git8633870.el7.centos.x86_64
 Go version:      go1.9.4
 Git commit:      8633870/1.13.1
 Built:           Fri Sep 28 19:45:08 2018
 OS/Arch:         linux/amd64

Server:
 Version:         1.13.1
 API version:     1.26 (minimum version 1.12)
 Package version: docker-1.13.1-75.git8633870.el7.centos.x86_64
 Go version:      go1.9.4
 Git commit:      8633870/1.13.1
 Built:           Fri Sep 28 19:45:08 2018
 OS/Arch:         linux/amd64
 Experimental:    false
[root@rancher-agent ~]# 

操作系统版本

[root@rancher-agent ~]# cat /etc/centos-release
CentOS Linux release 7.5.1804 (Core) 
[root@rancher-agent ~]# 

本机IP是192.168.0.189

[root@rancher-agent ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:31:b8:81 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.189/24 brd 192.168.0.255 scope global noprefixroute ens33
       valid_lft forever preferred_lft forever
    inet6 fe80::653b:6d78:6f49:36ce/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
    inet6 fe80::6082:90d5:bfd:516b/64 scope link tentative noprefixroute dadfailed 
       valid_lft forever preferred_lft forever
    inet6 fe80::8c17:3cfb:9e39:f0cc/64 scope link tentative noprefixroute dadfailed 
       valid_lft forever preferred_lft forever

 

根据网上查询资料docker 1.13.1只要修改daemon.json文件

Create or modify /etc/docker/daemon.json

{ "insecure-registries":["192.168.0.190"] }
Restart docker daemon

   systemctl restart docker.service

根据上面已经配置了docker daemon.json文件

[root@rancher-agent ~]# vim /etc/docker/daemon.json

{
"registry-mirrors": ["https://fy707np5.mirror.aliyuncs.com"],
 "insecure-registries":["192.168.0.190:9090"]
}

 

[root@rancher-agent ~]# docker push 192.168.0.190:9090/spring_cloud/eurekaserver:v1.0.0
The push refers to a repository [192.168.0.190:9090/spring_cloud/eurekaserver]
Get https://192.168.0.190:9090/v1/_ping: dial tcp 192.168.0.190:9090: getsockopt: connection refused

加"insecure-registries":["192.168.0.190:9090"错误区别

Put http://192.168.0.190:9090/v1/repositories/spring_cloud/eurekaserver/: dial tcp 192.168.0.190:9090: getsockopt: connection refused
Get https://192.168.0.190:9090/v1/_ping: dial tcp 192.168.0.190:9090: getsockopt: connection refused

 

还是报错。请各位老师指教,不知道哪里配错了。

CentOSDockerHarbor
文明上网,理性发言
客户端 Android iPhone WP7