首页 > 代码库 > centos7 docker registry push错误“server gave HTTP response to HTTPS client”

centos7 docker registry push错误“server gave HTTP response to HTTPS client”

系统环境:centos7

docker版本: 1.12.3(注意版本,可能存在不同版本设置不同的情况)

docker registry版本:2.4.1

问题:

成功安装docker registry,在浏览器中输入http://192.168.1.100:5000/v2,成功返回json数据。在push 到docker registry时,报:

[root@master sysconfig]# docker push 192.168.1.100:5000/registry:2.4.1The push refers to a repository [192.168.1.100:5000/registry]Get https://192.168.1.100:5000/v1/_ping: http: server gave HTTP response to HTTPS client

这个问题可能是由于docker registry 未采用https服务所致。

很多文章都是通过修改docker的配置文件“etc/systemconfig/docker",重启docker来解决这个问题。但发现docker1.12.3版本并无此文件,根据网上创建此文件,并填入相应内容,重启docker无效果,仍然报此错误。

 

解决方法:

在”/etc/docker/“目录下,创建”daemon.json“文件。在文件中写入:

{ "insecure-registries":["192.168.1.100:5000"] }

保存退出后,重启docker。问题解决:

[root@master docker]# docker push 192.168.1.100:5000/registry:2.4.1The push refers to a repository [192.168.1.100:5000/registry]ee8e809cfde5: Pushedba20d499f984: Pushed705e35f12f24: Pushed42755cf4ee95: Pushed2.4.1: digest: sha256:b66c4af9577744ae6d32e975808230e2ff558a5d50a7968d5102a900e147f3d5 size: 1158

 

参考文章:

http://stackoverflow.com/questions/38695515/can-not-pull-push-images-after-update-docker-to-1-12

 

centos7 docker registry push错误“server gave HTTP response to HTTPS client”