3 ms·
I'd suspect a great deal of people are secretly benefiting from qemu when they do $(docker build --platform linux/{arm64,amd64}) courtesy of binfmt_misc and a s
by mdaniel 1y ago
I'd suspect a great deal of people are secretly benefiting from qemu when they do $(docker build --platform linux/{arm64,amd64}) courtesy of binfmt_misc and a static copy of qemu
- https://github.com/moby/buildkit/blob/v0.23.2/docs/multi-platform.md#:~:text=it%20gets%20executed%20using%20a%20qemu%20user-mode%20emulator https://github.com/moby/buildkit/blob/v0.23.2/docs/multi-pla...
- https://github.com/moby/buildkit/blob/v0.23.2/Dockerfile#L165 https://github.com/moby/buildkit/blob/v0.23.2/Dockerfile#L16...
- https://github.com/tonistiigi/binfmt/blob/buildkit/v9.2.2-54/Dockerfile#L8 https://github.com/tonistiigi/binfmt/blob/buildkit/v9.2.2-54...
- https://github.com/tonistiigi/binfmt/blob/buildkit/v9.2.2-54/cmd/binfmt/main.go#L52 https://github.com/tonistiigi/binfmt/blob/buildkit/v9.2.2-54... and https://github.com/tonistiigi/binfmt/blob/buildkit/v9.2.2-54/cmd/binfmt/config.go#L29 https://github.com/tonistiigi/binfmt/blob/buildkit/v9.2.2-54...
and let me tell you from first-hand experience, that trying to swap in an updated version of the bundled qemu binary when the static version panics on some mis-emulated instruction is some whooooooo, boy
- mdaniel 1y agoThen again, everything in buildkit is designed for maximum opacity, in my experience so I guess it tracks