Get https://10.0.0.12/v2/: dial tcp 10.0.0.12:443: connect: connection refused

情况:

在使用docker企业级私有仓库时,推送镜像到仓库出现如下报错

[root@docker01 docker]# docker tag alpine:latest 10.0.0.12/library/alpine:latest
[root@docker01 docker]# docker push 10.0.0.12/library/alpine:latest 
The push refers to repository [10.0.0.12/library/alpine]
Get https://10.0.0.12/v2/: dial tcp 10.0.0.12:443: connect: connection refused

 

原因:

没有配置https证书,但是我们可以使用http协议进行访问

 

方法一:使用http协议访问

#在放docker镜像的服务器上面操作
#10.0.0.12为仓库地址
[root@docker01 docker]# vim /etc/docker/daemon.json
{
"insecure-registries": ["10.0.0.12"]
}
#重启docker
[root@docker01 docker]# systemctl  restart docker

#登录harbor仓库
[root@docker01 docker]# docker login 10.0.0.12
Username: admin
Password: 
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

 

方法二:使用https访问

http://blog.alittletiger.com/2670.html

 

结果:

[root@docker01 docker]# docker push 10.0.0.12/library/alpine:latest
The push refers to repository [10.0.0.12/library/alpine]
1bfeebd65323: Pushed
latest: digest: sha256:57334c50959f26ce1ee025d08f136c2292c128f84e7b229d1b0da5dac89e9866 size: 528
[root@docker01 docker]#

 

赞赏

微信赞赏支付宝赞赏

故障案例

The push refers to repository-denied: requested access to the resource is denied

2020-3-3 9:42:34

故障案例

kernel panic - not syncing: Attempted to kill init!

2020-3-16 9:37:00

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
有新消息 消息中心
搜索