gpt4 book ai didi

jenkins - 为什么 Docker 在将图像推送到私有(private)注册表时会重置连接?

转载 作者:行者123 更新时间:2023-12-02 21:26:41 24 4
gpt4 key购买 nike

我们有一个 Docker 私有(private)注册表,监听一个非默认端口(在我们的 docker run 命令中指定)。但是,我们推送图像(预构建或通过 Jenkins 构建)的尝试失败并显示错误消息(请参见下面的粗体)。我们将非常感谢您尽早提供帮助。

我们只是在机器上安装了 Docker 并启动了注册表,如下所示:
docker run -d -p 9010:9010 --restart=always --name registry registry:2

然后我们尝试根据 Docker 的文档测试我们的注册表,如下所示:
docker pull ubuntu && docker tag ubuntu localhost:9010/ubuntu
docker push localhost:9010/ubuntu

错误:
The push refers to a repository [localhost:9010/ubuntu]
Put http://localhost:9010/v1/repositories/ubuntu/: read tcp [::1]:37399->[::1]:9010: read: connection reset by peer

Jenkins 错误:
[workspace] $ docker push HOSTNAME:9010/registry:2
The push refers to a repository [HOSTNAME:9010/registry]
unable to ping registry endpoint https://HOSTNAME:9010/v0/
v2 ping attempt failed with error: Get https://HOSTNAME:9010/v2/: dial tcp IP_ADDRESS:9010: getsockopt: connection refused
v1 ping attempt failed with error: Get https://HOSTNAME:9010/v1/_ping: dial tcp IP_ADDRESS:9010: getsockopt: connection refused

最佳答案

您必须信任 docker 配置中的远程仓库

我认为该文件位于/etc/default/docker

你需要做 DOCKER_OPTS --insecure-registry

谷歌,你会找到你需要添加的行

关于jenkins - 为什么 Docker 在将图像推送到私有(private)注册表时会重置连接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36654569/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com