redhat-actions / buildah-build

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

[FEATURE] Improve 'Multi arch builds' documentation for self-hosted runners #58

Closed agterdenbos closed 3 years ago

agterdenbos commented 3 years ago

Is your feature request related to a problem? Please describe.

I encountered a few issues when using multi-architecture support:

  1. The docker image for sudo podman run --rm --privileged multiarch/qemu-user-static --reset -p yes is available from the docker.io registry, but the registry prefix is missing in the command. It now shows an error message (Ubuntu 21.04) or asks which registry to use (CentOS 8).
  2. The current README assumes that the host is running amd64 architecture. This assumption is not correct when using self-hosted runner applications for arm64 and arm32 architectures.
  3. The multiarch/qemu-user-static image is only available for the amd64 architecture. A multi-architecture image would be preferred instead.
  4. It seems that QEMU and binfmt support is only needed for multi-arch builds from dockerfiles that do contain RUN instructions. buildah run is not called by this action. Using qemu-user-static for other builds might unnecessary slow them down and consume additional bandwidth.
  5. The Multi arch builds section talks about installing qemu-user-static. The word install suggests that the changes are still present after a reboot of the host machine. However, this process should be repeated after each reboot.

Describe the solution you'd like

  1. Use sudo podman run --rm --privileged docker.io/multiarch/qemu-user-static --reset -p yes instead, which includes the docker.io prefix.
  2. Any reference to amd64 should be replaced by host architecture.
  3. Use sudo podman run --rm --privileged docker.io/tonistiigi/binfmt --install all because it supports 8 different host architectures. The same image is also used by docker/setup-qemu-action
  4. In the Inputs for build without dockerfile section, remove the reference to Multi arch builds. In the Multi arch builds section, describe that qemu-user-static is only needed when RUN instructions are used in dockerfiles.
  5. Describe that the process must be repeated after rebooting the host machine. Or suggest to run sudo apt install -y qemu-user-static.

Describe alternatives you've considered

  1. sudo podman run --rm --privileged docker.io/aptman/qus -s -- -p could also be an option

Additional context

  1. Error on Ubuntu 21.04: error getting default registries to try: short-name "multiarch/qemu-user-static" did not resolve to an alias and no unqualified-search registries are defined in "/etc/containers/registries.conf"
  2. Error: {"msg":"exec container process /register: Exec format error","level":"error","time":"2021-06-14T12:23:06.000446093Z"}
tetchel commented 3 years ago

OK, we'll have another look at this documentation.

Thank you for coming back to us with this feedback, it is valuable to know the pain points you experienced.