GitLab CI/CD - publish 镜像到私有镜像仓库出错

2021-07-20 18:44:49 +08:00
 JasonLaw

GitLab CI/CD 的报错如下:

Get https://registry-1.docker.io/v2/library/openjdk/manifests/11: Get https://auth.docker.io/token?scope=repository%3Alibrary%2Fopenjdk%3Apull&service=registry.docker.io: read tcp 172.17.0.2:34818->54.236.165.68:443: read: connection reset by peer

私有镜像仓库是通过 docker-compose 启动的,docker container logs -f docker-registry_registry_1的日志如下:

time="2021-07-20T10:21:00.32369399Z" level=warning msg="error authorizing context: basic authentication challenge for realm "Registry": invalid authorization credential" go.version=go1.11.2 http.request.host="localhost:5000" http.request.id=0c53faae-b4f7-4045-aaca-5f46f695e5e8 http.request.method=GET http.request.remoteaddr="172.19.0.1:39438" http.request.uri="/v2/" http.request.useragent="docker/18.09.9 go/go1.11.13 git-commit/039a7df9ba kernel/5.4.0-73-generic os/linux arch/amd64 UpstreamClient(Docker-Client/18.09.9 \(linux\))"
time="2021-07-20T10:21:00.341567217Z" level=info msg="authorized request" go.version=go1.11.2 http.request.host="localhost:5000" http.request.id=c0e7d139-ddd0-42a9-8357-047f2d816659 http.request.method=GET http.request.remoteaddr="172.19.0.1:39444" http.request.uri="/v2/" http.request.useragent="docker/18.09.9 go/go1.11.13 git-commit/039a7df9ba kernel/5.4.0-73-generic os/linux arch/amd64 UpstreamClient(Docker-Client/18.09.9 \(linux\))"
time="2021-07-20T10:21:00.341643848Z" level=info msg="response completed" go.version=go1.11.2 http.request.host="localhost:5000" http.request.id=c0e7d139-ddd0-42a9-8357-047f2d816659 http.request.method=GET http.request.remoteaddr="172.19.0.1:39444" http.request.uri="/v2/" http.request.useragent="docker/18.09.9 go/go1.11.13 git-commit/039a7df9ba kernel/5.4.0-73-generic os/linux arch/amd64 UpstreamClient(Docker-Client/18.09.9 \(linux\))" http.response.contenttype="application/json; charset=utf-8" http.response.duration=3.213474ms http.response.status=200 http.response.written=2

在 ECS 上 publish 镜像到私有镜像仓库没问题,但在 GitLab CI/CD 中却不行,有人知道是什么问题吗?😭

1672 次点击
所在节点    程序员
5 条回复
simonlu9
2021-07-20 19:01:03 +08:00
你要先登录吧
JasonLaw
2021-07-20 20:09:26 +08:00
在 publish 之前已经成功登录了

JasonLaw
2021-07-20 20:10:21 +08:00
@simonlu9 #1 忘记 @ 你了

@JasonLaw #2
a2001103
2021-07-21 00:02:42 +08:00
gitlab 是怎么部署的呀
simonlu9
2021-07-21 09:13:53 +08:00
@JasonLaw 这种大概率是网络连接超时,为什么不用国内的私有镜像库

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/790681

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX