docker - 码头工人注册表:https而不是http
问题描述
我刚刚部署了一个 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
?
解决方案
Docker 默认使用 https 来保证安全。您可以通过daemon.json
使用以下内容修改文件来覆盖此设置。不要在生产中使用此设置。
{
"insecure-registries" : ["chart-example.local"]
}
有关更多信息,请参阅此链接:https ://docs.docker.com/registry/insecure/
推荐阅读
- javascript - CSS 位置:sticky 在向上滚动和向下滚动时表现不同
- java - 如何使用 DateTimeFormatter 解析“Feb 25”和“February 25”?
- c++ - 如果模板参数很复杂,则在模板函数中应用 std::conj
- reactjs - 反应材料容器页眉主要和页脚它未使用页眉中的 flexbox 对齐
- javascript - SVG 成功消息动画
- django - 测试中 Django 3.0 与 3.1 中的 MEDIA URL 不一致
- javascript - 使用函数获取数据 - JavaScript 中的 sqlite3
- sql-server - 键集分页 - 按多列搜索词过滤
- java - 为什么 DatagramSocket 在某些电脑中不发送
- angular - 在 Angular 中按字母顺序排序