11

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

 2 years ago
source link: https://www.v2ex.com/t/790681
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

V2EX  ›  程序员

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

  JasonLaw · 4 小时 35 分钟前 · 149 次点击

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 中却不行,有人知道是什么问题吗?😭


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK