On Tue, Apr 27, 2021 at 10:41:04PM +0200, Jan Christian Grünhage wrote:
Okay, this was quite helpful, figured out the binfmt error. Void Linux has a similar service to the systemd-binfmt.service, which is in a package that's not depended upon by qemu-user-static. Installed that package and reconfigured qemu-user-static, now I don't get binfmt related errors anymore. That doesn't mean that buildah is happy though:
``` ➤ buildah bud --pull --manifest test --platform linux/arm64 . STEP 1: FROM docker.io/alpine Getting image source signatures Copying blob 595b0fe564bb done Copying config 3fcaaf3dc9 done Writing manifest to image destination Storing signatures STEP 2: RUN arch standard_init_linux.go:219: exec user process caused: no such file or directory error building at STEP "RUN arch": error while running runtime: exit status 1 ERRO exit status 1 ```
That's still not super helpful, not sure how to continue here. I'll try this again in a VM tomorrow, on a Fedora machine or a Debian machine, if that works out I'll go bother the Void people instead.
I took another look at Fedora's packaging, and its qemu-user-static munges the configurations to use copies of the emulators that are statically linked, and registers them with the "F" flag. The "F" flag lets the kernel successfully run binaries under the emulators when the mount namespaces that those binaries are in don't have the emulators in them [1], and I expect (but haven't personally verified by tweaking my own system to check) that the static linking prevents similar problems due to a lack of specific shared libraries that a dynamically linked emulator would have been linked with. HTH, Nalin [1] https://www.kernel.org/doc/html/latest/admin-guide/binfmt-misc.html