V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
JasonLaw
V2EX  ›  程序员

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

  •  
  •   JasonLaw · 2021-07-20 18:44:49 +08:00 · 1672 次点击
    这是一个创建于 1222 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    第 1 条附言  ·  2021-07-21 20:59:01 +08:00

    其实真正的问题是pull不到image,是我自己搞错了,跟GitLab CI/CD没啥关系。但是只有这一台服务器pull不到,其它服务器是可以的。

    刚刚发现了一个类似的主题:registry-1.docker.io 无法访问 - V2EX

    5 条回复    2021-07-21 09:13:53 +08:00
    simonlu9
        1
    simonlu9  
       2021-07-20 19:01:03 +08:00
    你要先登录吧
    JasonLaw
        2
    JasonLaw  
    OP
       2021-07-20 20:09:26 +08:00
    在 publish 之前已经成功登录了

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

    @JasonLaw #2
    a2001103
        4
    a2001103  
       2021-07-21 00:02:42 +08:00
    gitlab 是怎么部署的呀
    simonlu9
        5
    simonlu9  
       2021-07-21 09:13:53 +08:00
    @JasonLaw 这种大概率是网络连接超时,为什么不用国内的私有镜像库
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2833 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 09:26 · PVG 17:26 · LAX 01:26 · JFK 04:26
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.