redhat-actions / buildah-build

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

Add support for 'platform' parameter #75

Closed jayaddison closed 2 years ago

jayaddison commented 3 years ago

Description

This adds support for the platform argument to buildah, which can be used to configure the build OS, architecture and variant within a single parameter.

Related Issue(s)

Resolves #65.

Checklist

Changes made

Add the platform argument to both from-scratch and from-container-file build paths.

jayaddison commented 3 years ago

Thank you @divyansh42 for the review; I'll make those changes here soon, hopefully within the next few days.

jayaddison commented 2 years ago

Reading a bit more of the history of the platform option, I noticed that https://github.com/containers/buildah/commit/41ea9343d9cbcca50684337e2911336e814c8804 (released in v1.23.0) recently added support for multiple platform values (the option changes from a singleton String type into a list-based StringSlice type).

That makes me wonder whether we should use getInputList to retrieve platform? (a YAML list isn't possible because GitHub Actions is awaiting support for a list input type)

divyansh42 commented 2 years ago

Reading a bit more of the history of the platform option, I noticed that containers/buildah@41ea934 (released in v1.23.0) recently added support for multiple platform values (the option changes from a singleton String type into a list-based StringSlice type).

That makes me wonder whether we should use getInputList to retrieve platform? (a YAML list isn't possible because GitHub Actions is awaiting support for a list input type)

@jayaddison Ubuntu 20.04 runners are still on buildah 1.21.3, so I think we'll have to wait for runners to update buildah to support multiple platform input. For now probably we can go with single platform and meanwhile we can create an issue to add support for multiple platform once we have buildah v1.23.0 available.

jayaddison commented 2 years ago

I'm not certain whether this is the exact cause of the build failures at 7b92604ecc1a311850eb3768bd8d14769bf861f3, but I noticed that the available OS/Arch list on Docker Hub uses a full os/arch/variant format for the ARM64v8 image.

image

I've pushed 987134053888e4d91890a5044bd24fe19220d5d5 as an experiment to see if updating the platform argument to use that fixes the build, but am experimenting a bit at this point.

divyansh42 commented 2 years ago

I'm not certain whether this is the exact cause of the build failures at 7b92604, but I noticed that the available OS/Arch list on Docker Hub uses a full os/arch/variant format for the ARM64v8 image.

image

I've pushed 9871340 as an experiment to see if updating the platform argument to use that fixes the build, but am experimenting a bit at this point.

linux/arm64/v8 worked :+1:

tetchel commented 2 years ago

Please fix the merge conflicts (https://github.com/redhat-actions/buildah-build/pull/76 went in)

jayaddison commented 2 years ago

Thanks both - merge conflicts now resolved.