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

Viewed 4794

After pushing a commit to GitLab the build pipeline starts to check the new commit. Build and Test stage run successfully. But the Deploy stage stops with the following error:

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)

What could be the reason behind that?

2 Answers

I had the same problem, I solved it by rebuilding and republishing the docker image that the GitLab CI file was referencing and then re-run the pipeline again and it worked.

There is no latest tag for that specific docker image. Most likely you're building using a specific tag, e.g v1.0:

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

then using that image without a tag in your .gitlab-ci.yml:

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

# OR

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

To fix, either specify a tag in you ci file, or tag the image with latest when building:

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

The gitlab docker template has a nice example of how to automatically tag a build as latest on the default branch: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Docker.gitlab-ci.yml

Related