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

[BUG] building multi-arch should report on missing base image for the platform #99

Open akostadinov opened 2 years ago

akostadinov commented 2 years ago

Version

redhat-actions/push-to-registry@v2.10

Describe the bug

First of all documentation is misleading in this part:

The archs and platforms arguments override the Architecture and Platform labels in the output image, respectively. They do not actually affect the architectures and platforms the output image will run on. The image must still be built for the required architecture or platform.

They do actually affect the architectures and platforms the output image will run on. Here comes the actual issue I want to report. They do affect but in case base image does not exist for the desired non-native target architectures, then the build succeeds, labels are fine, just all generated images are for the native platform without any warning or error.

I think it serves users much better to fail when base image for the target platform is missing. This will reduce confusion and make debugging process much quicker.

Steps to reproduce, workflow links, screenshots

Workflow 1 with a base image with all target architectures:

...
STEP 2/3: RUN uname -a && echo && env
time="2022-07-01T09:54:53Z" level=warning msg="Failed to decode the keys [\"machine\"] from \"/usr/share/containers/containers.conf\"."
Linux 7db1804db6ae 5.13.0-1031-azure #37~20.04.1-Ubuntu SMP Mon Jun 13 22:51:01 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
...
STEP 2/3: RUN uname -a && echo && env
time="2022-07-01T09:55:02Z" level=warning msg="Failed to decode the keys [\"machine\"] from \"/usr/share/containers/containers.conf\"."
Linux c8f0c044e788 5.13.0-1031-azure #37~20.04.1-Ubuntu SMP Mon Jun 13 22:51:01 UTC 2022 s390x s390x s390x GNU/Linux
...
 STEP 2/3: RUN uname -a && echo && env
time="2022-07-01T09:55:12Z" level=warning msg="Failed to decode the keys [\"machine\"] from \"/usr/share/containers/containers.conf\"."
Linux 1b0c3fce6405 5.13.0-1031-azure #37~20.04.1-Ubuntu SMP Mon Jun 13 22:51:01 UTC 2022 ppc64le ppc64le ppc64le GNU/Linux
...

Workflow 2 with base image that has only amd64 arch:

...
STEP 2/3: RUN uname -a && echo && env
time="2022-07-01T10:15:54Z" level=warning msg="Failed to decode the keys [\"machine\"] from \"/usr/share/containers/containers.conf\"."
Linux 2ebf20e578e0 5.13.0-1031-azure #37~20.04.1-Ubuntu SMP Mon Jun 13 22:51:01 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
...
 STEP 2/3: RUN uname -a && echo && env
time="2022-07-01T10:16:18Z" level=warning msg="Failed to decode the keys [\"machine\"] from \"/usr/share/containers/containers.conf\"."
Linux 2ebf20e578e0 5.13.0-1031-azure #37~20.04.1-Ubuntu SMP Mon Jun 13 22:51:01 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
...
 STEP 2/3: RUN uname -a && echo && env
time="2022-07-01T10:16:31Z" level=warning msg="Failed to decode the keys [\"machine\"] from \"/usr/share/containers/containers.conf\"."
Linux 2ebf20e578e0 5.13.0-1031-azure #37~20.04.1-Ubuntu SMP Mon Jun 13 22:51:01 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
...
naveenrajm7 commented 10 months ago

+1
I ran into the same issue, I was able to reproduce this by directly using buildah. I think this issue belongs to buildah itself rather than this buildah wrapper GitHub Action.