krill icon indicating copy to clipboard operation
krill copied to clipboard

Docker push fails for release tag

Open ximon18 opened this issue 3 years ago • 1 comments

GitHub Actions workflow pkg run https://github.com/NLnetLabs/krill/actions/runs/2994084685 failed at the final step: docker-manifest.

Actually it failed earlier than that at the matrix of docker jobs but the steps themselves didn't fail, rather they pushed the created image to the wrong tag in Docker Hub. The manifest push step then failed because the separate component images didn't exist with the expected tags.

The root cause of this is two-fold:

  • Firstly, the docker/metadata-action@v3 returned multiple line-break separated tags for nlnetlabs/krill:v0.10.0 and nlnetlabs/krill:latest. This didn't happen when the worfkflow was tested by forking this repo to the ximon18/krill repo because it only output a single tag for the version, it did not output the latest tag as well though I don't know why not. We should either get a single tag only or handle the line breaks.

  • Secondly, the old :latest tag needs to be replaced by a pushed manifest rather than a pushed tag. Unlike tags, a manifest can't be copied to a new name and pushed again. We therefore need to call docker manifest create and docker manifest push twice each, once for the nlnetlabs/krill:v0.10.0 tag and once for the nlnetlabs/krill:latest tag.

I've fixed the issue manually for now by downloading the docker image tarballs from the failed workflow saved artifacts, building the manifests locally and pushing them to Docker Hub, as the alternative was a delay while working out how to fix the workflow and long delays testing and finally running the modifieid workflow. So the workflow still needs fixing to avoid this failure happening again.

ximon18 avatar Sep 05 '22 22:09 ximon18

A local test (after deleting all local nlnetlabs/krill images) shows all pushed tags/manifests working and reporting v0.10.0: (note: I stripped output showing image pulling to make it easier to see the result of the run command)

$ docker run -it --rm nlnetlabs/krill krillc --version
Krill Client 0.10.0

$ docker run -it --rm nlnetlabs/krill:latest krillc --version
Krill Client 0.10.0

$ docker run -it --rm nlnetlabs/krill:v0.10.0 krillc --version
Krill Client 0.10.0

$ docker images nlnetlabs/krill --format "{{.Repository}} {{.Tag}} {{.ID}} {{.CreatedAt}} {{.Size}} {{.Digest}}"
nlnetlabs/krill latest 8757e8a6b915 2022-09-05 17:10:16 +0200 CEST 74.5MB sha256:142cb6d303660ba8216a982535fc44986aebe99b1bea54140287a36725758535
nlnetlabs/krill v0.10.0 8757e8a6b915 2022-09-05 17:10:16 +0200 CEST 74.5MB sha256:142cb6d303660ba8216a982535fc44986aebe99b1bea54140287a36725758535

Notice that the image ID and sha256 digest values are the same for both locally available tags :v0.10.0 and :latest.

ximon18 avatar Sep 05 '22 22:09 ximon18

This issue is no longer occurring and was presumably resolved within Ploutos.

ximon18 avatar Dec 06 '23 14:12 ximon18