From 0caed3c9470c970ef74d170a664bcc2a254dba4c Mon Sep 17 00:00:00 2001 From: Philip Couling Date: Mon, 17 Jan 2022 21:25:41 +0000 Subject: [PATCH] Update working-with-buildx.md The current wording is a little misleading on QEMU and binfmt_misc. This is a problem Ubuntu and, maybe, other distributions. > For QEMU binaries registered with `binfmt_misc` on the host OS to work transparently inside containers they must be registered with the `fix_binary` flag. This requires a kernel >= 4.8 and binfmt-support >= 2.1.7. You can check for proper registration by checking if `F` is among the flags in `/proc/sys/fs/binfmt_misc/qemu-*`. This implies that setting the fix_binary flag on otherwise installed QEMU & binfmt_msc will work; it probably wont. Eg installing Ubuntu packages `qemu-user` `qemu-user-binfmt` will install dynamically linked QEMU and binfmt_msc entries without the `F` flag. Manually adding `F` to the flags will break because `F` (fix_binary) is incompatible with dynamically linked binaries. (Referenced in [this Redhat issue](https://bugzilla.redhat.com/show_bug.cgi?id=1470397)) It actually results in really hard to diagnose "No such file or directory" errors. Instead you must install the ubuntu package `qemu-user-static`. Obviously this page can't document every distribution so I'm not going to recommend describing how to do it under Ubuntu. My suggestion is to simply state that QEMU must be statically compiled. At least this gives readers a chance to figure it out. --- buildx/working-with-buildx.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildx/working-with-buildx.md b/buildx/working-with-buildx.md index b98ba19ad2..7a71b47fb7 100644 --- a/buildx/working-with-buildx.md +++ b/buildx/working-with-buildx.md @@ -185,7 +185,7 @@ handler. For QEMU binaries registered with `binfmt_misc` on the host OS to work transparently inside containers they must be registered with the `fix_binary` -flag. This requires a kernel >= 4.8 and binfmt-support >= 2.1.7. You can check +flag and QEMU must be staticaly compiled. This requires a kernel >= 4.8 and binfmt-support >= 2.1.7. You can check for proper registration by checking if `F` is among the flags in `/proc/sys/fs/binfmt_misc/qemu-*`. While Docker Desktop comes preconfigured with `binfmt_misc` support for additional platforms, for other installations