簡體   English   中英

docker 推送到 nexus 注冊表(代理后)以 EOF 結尾

[英]docker push to nexus registry (behind proxy) ends with EOF

我已經嘗試了很多,但我找不到解決這個問題的方法。

我在 vthunder a10 代理后面的 centos7 服務器上運行 nexus sonatype (3.21.1-01) docker 映像。
docker 登錄和拉取效果很好,但docker 在重試后會出現 EOF 推送失敗

這里感興趣的路線:

  • docker 鏡像端口 8081 > my.server:8081
  • docker 鏡像端口 8443 > my.server:8443
  • proxy.domain.local:443 > my.server:8081
  • proxy.domain.local:8443 > my.server:8443
  • 我在 nexus 中創建了一個 docker 存儲庫,其中http 連接器暴露在 8443
  • 代理暴露在 ssl 下,帶有自簽名證書
  • 客戶端的 /etc/docker/daemon.json 文件包含不安全的注冊表選項:
    "insecure-registries": ["proxy.domain.local:8443","proxy.domain.local"]

這里的情況:

  1. 如果我嘗試從客戶端推送遠程服務器上已經存在所有層的圖像(但在 nexus 存儲庫中缺失),它可以工作。

  2. 如果我嘗試相同但在同一圖像上添加一些差異(例如新標簽),它會以這種方式失敗:

(9c27e219663c: Layer already exists 
Patch https://proxy.domain.local:8443/v2/test4/blobs/uploads/6862fe60-d63b-4942-bbb6-f403307e677a: EOF)
  1. 如果我直接從 my.server 機器推送,指向 localhost:8443 它可以工作。

  2. 如果我從客戶端機器推送一個帶有新層的圖像,它會在重試后以這種方式失敗(對於較小的圖像具有相同的行為):

docker push proxy.domain.local:8443/ara
The push refers to repository [proxy.domain.local:8443/ara]
edb7a4f74e22: Retrying in 8 seconds 
de421654540d: Retrying in 8 seconds
-------------
The push refers to repository [proxy.domain.local:8443/ara]
edb7a4f74e22: Pushing [==================================================>]  172.6MB/172.6MB
de421654540d: Pushing [==================================================>]  200.8MB/200.8MB
EOF

這是對wireshark中發生的事情的總結

the.client  my.server   HTTP    316 GET /v2/ HTTP/1.1 
...
my.server   the.client  HTTP    654 HTTP/1.1 401 Unauthorized  (application/json)
...
the.client  my.server   HTTP    442 HEAD /v2/alpine-test/blobs/sha256:95f5ecd24e438e09033c8e69ec136079f8774ab8284f1431f5433a829054b5e7 HTTP/
(asking to nexus if the image is already uploaded)
my.server   the.client  HTTP    493 HTTP/1.1 404 Not Found 
(it isn't)
the.client  my.server   HTTP    437 POST /v2/alpine-test/blobs/uploads/ HTTP/1.1 
(so it start to post the image)
my.server   the.client  HTTP    584 HTTP/1.1 202 Accepted 
...
the.client  my.server   HTTP    437 POST /v2/alpine-test/blobs/uploads/ HTTP/1.1 
...
my.server   the.client  HTTP    584 HTTP/1.1 202 Accepted
..
and so on with some FIN/ACK in the middle until the client stops to send it...

** 在 nexus 服務器日志上,絕對沒有關於此的任何痕跡 **

這是 nexus docker 組成:

services:

  nexus:
    build:
      context: .
      args:
        DOCKER_GID: ${DOCKER_GID}
        NEXUS_UID: ${NEXUS_UID}
        NEXUS_GID: ${NEXUS_GID}
    restart: always
    environment:
      - NEXUS_UID_GID=${NEXUS_UID_GID}
      - HOSTNAME_DOCKER_NEXUS=${HOSTNAME_DOCKER_NEXUS}
    ports:
      - "8081:8081"
      - "8443:8443"
    user: ${NEXUS_UID_GID}
    hostname: ${HOSTNAME_DOCKER_NEXUS}
    volumes:
      - /var/nexus-data:/nexus-data
      - /etc/hosts:/etc/hosts
      - /var/run/docker.sock:/var/run/docker.sock

你能幫助我嗎?

我正在考慮本地機器/docker二進制權限上可能存在的nexus-docker-user權限問題(如果我從localhost嘗試它可以工作,是的,但是圖像當然已經存儲在系統上) - 但我認為它是不太可能。

我也在考慮代理配置問題(更有可能),但我對代理了解不多。

[解決方法] 因為我無法解決問題,所以我最終通過它的 jetty.xml、jetty.Z5E056C500A1C4B6BADE.5Z10 和 nexusB50D807BADE5Z 使代理透明並配置 nexus 直接在 https 中服務

直接從碼頭服務 https 而不是讓代理升級連接解決了上述問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM