记录一下自己在自建Docker仓库的时候遇到的一个报错
- 问题
docker push registry:5000/library/centos:7
The push refers to repository [registry:5000/library/centos]
Get "https://registry:5000/v2/": http: server gave HTTP response to HTTPS client
- 解决办法
vim /etc/docker/daemon.json
{...# 这里后面一定要写两个哈,我这里就写成一样的了"insecure-registries": ["registry:5000","registry:5000"]
}systemctl restart docker
docker push registry:5000/library/centos:7
# success
- 个人猜测:
insecure-registries
这个后面的列表中第一个使用的是https
,第二个是使用的http
。