redhat-actions / buildah-build

GitHub Action to use 'buildah' to build a container image.
https://github.com/marketplace/actions/buildah-build
MIT License
136 stars 35 forks source link

Forcibly remove existing manifest before creating a new one #103

Closed der-eismann closed 1 year ago

der-eismann commented 1 year ago

Description

We are using this action to build multiarch images on our own runners. However when a build is running on the same runner multiple times we get the following error:

/bin/buildah manifest create 12345678901.dkr.ecr.eu-west-1.amazonaws.com/base-image-java:9-move-to-gha
error creating image to hold manifest list: 
  image name "12345678901.dkr.ecr.eu-west-1.amazonaws.com/base-image-java:9-move-to-gha" is already associated
  with image "b13b58c4add1afbad60f0062ad3beb2d5fc5c5b11d6f0881213214dd4d6e10de": that name is already in use

This change executes a manifest rm and ignores the return code. Originally I was planning to do manifest exists and then conditionally remove, but unfortunately this feature exists only in podman and not in buildah (yet).

Related Issue(s)

Fixes #102

Checklist

Changes made

divyansh42 commented 1 year ago

@der-eismann Thanks for the PR! Could you please rebase your PR.

der-eismann commented 1 year ago

@der-eismann Thanks for the PR! Could you please rebase your PR.

Done!

der-eismann commented 1 year ago

@divyansh42 are you gone again?

divyansh42 commented 1 year ago

@der-eismann could please take a look at lint errors?

der-eismann commented 1 year ago

@der-eismann could please take a look at lint errors?

Done

der-eismann commented 1 year ago

@divyansh42 can you please merge this?

divyansh42 commented 1 year ago

@der-eismann created a release for the same. You can use this in v2 or v2.12 Thanks!