docker pull 报错:Get https://registry:5000/v1/_ping: http: server gave HTTP response to HTTPS client

 

 

docker pull 报错:Get https://registry:5000/v1/_ping: http: server gave HTTP response to HTTPS client

解决办法: 
[root@k8s-node-2 ~]# cat /etc/docker/daemon.json
{ "insecure-registries":["registry:5000"] }

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

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

//多个私服写法,逗号分隔即可
{
    "insecure-registries": [
        "registry:5000", 
        "registry2:5000"
    ]
}


保存退出后,重启docker

systemctl restart docker

 

[root@k8s-node-1 ~]# docker pull registry:5000/nginx
Using default tag: latest
Trying to pull repository registry:5000/nginx ...
Get https://registry:5000/v1/_ping: http: server gave HTTP response to HTTPS client
[root@k8s-node-1 ~]# service docker restart
Redirecting to /bin/systemctl restart docker.service
[root@k8s-node-1 ~]# docker pull registry:5000/nginx
Using default tag: latest
Trying to pull repository registry:5000/nginx ...
latest: Pulling from registry:5000/nginx
Digest: sha256:82b1834dfa74699d4013eb388dc4cfb9f549d6692f78194bf5e483733f6bb22f
[root@k8s-node-1 ~]# docker pull registry:5000/pod-infrastructure
Using default tag: latest
Trying to pull repository registry:5000/pod-infrastructure ...
latest: Pulling from registry:5000/pod-infrastructure
4b8ec2c40f02: Pull complete
9a825c117595: Pull complete
19ee892734bf: Pull complete
Digest: sha256:a378b2d7a92231ffb07fdd9dbd2a52c3c439f19c8d675a0d8d9ab74950b15a1b

posted on 2018-01-18 17:10  flyoss  阅读(6985)  评论(0编辑  收藏  举报

导航