解决自建docker registry客户端无法push的问题

按照官方推荐的方式,下载了registry的镜像,结果在另外一台电脑上镜像死活也推送不上去,持续报告这个错误: [root@localhost network-scripts]# docker push 192.168.120.129:5000/test The push refers to a repository [192.168.120.129:5000/test] (len: 1) unable to ping registry endpoint https://192.168.120.129:5000/v0/ v2 ping attempt failed with error: Get https://192.168.120.129:5000/v2/: dial tcp 192.168.120.129:5000: connection refused v1 ping attempt failed with error: Get https://192.168.120.129:5000/v1/_ping: dial tcp 192.168.120.129:5000: connection refused 其实就是docker尝试去使用https来增强安全性,但是我组建的docker registry是纯内网使用的,这种莫名其妙的增强安全性纯属浪费性能,所以直接禁用就好 直接禁用的办法也很简单,编辑/etc/sysconfig/docker,修改 OPTIONS='--selinux-enabled' 改为(后面的IP是你的registry所在的地址与端口) OPTIONS='--selinux-enabled --insecure-registry 192.168.120.129:5000' 当然,你也可以使用更为纯粹的方法,自己颁发证书或者是使用购买了的证书……方法见这里:https://docs.docker.com/registry/insecure/

评论

此博客中的热门博文

远程记录OpenWRT日志

用OpenWRT打造自动翻墙路由器(详解篇)

Python中为什么要用is None来代替== None?