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.
This commit is contained in:
Philip Couling 2022-01-17 21:25:41 +00:00 committed by GitHub
parent 4b292bec93
commit 0caed3c947
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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