泊坞窗注册表:https而不是http

时间:2020-01-28 20:13:59

标签: docker kubernetes docker-registry

我刚刚部署了一个Docker注册表。

我可以使用以下方式访问它:

$ curl -I chart-example.local/v2/                                                                                                                         
HTTP/1.1 200 OK
Content-Length: 2
Content-Type: application/json; charset=utf-8
Date: Tue, 28 Jan 2020 20:10:35 GMT
Docker-Distribution-Api-Version: registry/2.0
Vary: Accept-Encoding
X-Content-Type-Options: nosniff

但是,当我尝试向其推送本地图像时,却收到此消息:

$ docker push chart-example.local/feedly:latest                                                                                                                                                                                                                                                                          
The push refers to repository [chart-example.local/feedly]
Get https://chart-example.local/v2/: x509: certificate has expired or is not yet valid

为什么docker尝试使用https而不是http进行访问?

1 个答案:

答案 0 :(得分:3)

默认情况下,Docker使用https来确保安全。您可以通过使用以下内容修改daemon.json文件来覆盖此设置。 不要在生产中使用此设置。

 {
   "insecure-registries" : ["chart-example.local"]
 }

有关更多信息,请参见以下链接:https://docs.docker.com/registry/insecure/