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

[BUG] Undocumented challenges of setting up QEMU in public GHA #34

Closed webknjaz closed 3 years ago

webknjaz commented 3 years ago

Version

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

Describe the bug

$sbj. README says to use https://github.com/marketplace/actions/docker-setup-qemu but that does not work (I don't have a log anymore but it said something about the wrong architecture when I tried to build AARCH64 with archs: linux/arm64 set).

I managed to make it work by using

- name: >-
    Set up QEMU ${{ matrix.IMAGE.QEMU_ARCH }} arch emulation
    with Podman
  if: matrix.IMAGE.QEMU_ARCH == 'arm64'
  run: >-
    sudo podman run
    --rm --privileged
    multiarch/qemu-user-static
    --reset -p yes

I think it's worth documenting in README. And as a bonus, maybe it's worth wrapping this as an action mirroring docker/setup-qemu-action to encapsulate this command similar to other related actions.

Or maybe detect what the users set in the archs input and do this implicitly in this action.

Steps to reproduce, workflow links, screenshots

https://github.com/ansible/pylibssh/blob/7219ac6/.github/workflows/build-manylinux-container-images.yml