簡體   English   中英

Docker 之后的未知清單在提交到 GitLab 時拉入構建管道

[英]Unknown Manifest after Docker pull in build pipeline when committing to GitLab

將提交推送到 GitLab 后,構建管道開始檢查新提交。 構建和測試階段成功運行。 但 Deploy 階段因以下錯誤而停止:

Running with gitlab-runner 12.3.0 (a8a019e0)
  on gitlab-runner2 QNyj_HGG
Using Docker executor with image nexus.XXX.com/YYY/ZZZ-engines ...
Authenticating with credentials from /root/.docker/config.json
Pulling docker image nexus.XXX.com/YYY/ZZZ-engines ...
ERROR: Job failed: Error response from daemon: manifest for
 nexus.XXX.com/YYY/ZZZ-engines:latest not found: manifest unknown: manifest unknown (executor_docker.go:188:0s)

這背后的原因可能是什么?

我遇到了同樣的問題,我通過重建和重新發布 GitLab CI 文件正在引用的 docker 映像來解決它,然后再次重新運行管道並且它工作。

該特定 docker 圖像沒有latest標簽。 您很可能正在使用特定標簽構建,例如v1.0

docker build -t nexus.XXX.com/YYY/ZZZ-engines:v1.0 .

然后在.gitlab-ci.yml中使用不帶標簽的圖像:

image: nexus.XXX.com/YYY/ZZZ-engines

# OR

build-job:
  stage: build
  image: nexus.XXX.com/YYY/ZZZ-engines
  ...

要修復,要么在 ci 文件中指定一個標簽,要么在構建時用latest標記圖像:

docker build -t nexus.XXX.com/YYY/ZZZ-engines:v1.0 -t nexus.XXX.com/YYY/ZZZ-engines:latest .

gitlab docker 模板有一個很好的示例,說明如何在默認分支上自動將構建標記為latesthttps://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/ Docker.gitlab-ci.yml

暫無
暫無

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

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