This is the output I see: $ docker run --rm -it alpine sh ELF binary type "0" not known. ELF binary type "0" not known. jail: exec sh: Exec format error jail: sh: failed
Created attachment 182934 [details] Add ELF brand recognition for musl Linux x86_64 binaries This isn't a Docker problem, you'd get the same if you just extracted Alpine's rootfs and ran `jail -c path=$(pwd) mount.devfs ip4=inherit command=/bin/sh` there. When a binary isn't recognized, you can run brandelf(1) on it. However this would be terrible for actually doing work in a Linux jail — you install a package within Linux and the binary does not work and you have to brandelf it… So here's a patch that makes FreeBSD recognize these binaries.
Thanks Greg!
The patch works for me!
What about x86 binaries?
I have tried adding a similar section to the 32-bit thing but it didn't work, I probably messed something up. Who cares about 32-bit Linux containers anyway? :)
(In reply to Greg V from comment #5) I believe Docker on FreeBSD require 64-bit, so 32-bit support probably isn't worth worrying about.
(In reply to Yonas Yanfa from comment #6) Yeah. It's not all about Docker though.
(In reply to Greg V from comment #7) True. This issue has been open for a little while (7 months). Why don't we commit the patch we have now, and when we're able to figure out how to get 32-bit working, we can commit that later?
A commit references this bug: Author: dchagin Date: Mon Jul 3 10:24:49 UTC 2017 New revision: 320595 URL: https://svnweb.freebsd.org/changeset/base/320595 Log: Add support for musl consumers to the Linuxulator. PR: 213809 Submitted by: Yonas Yanfa Reported by: Yonas Yanfa MFC after: 1 week Relnotes: yes Changes: head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/i386/linux/linux_sysvec.c
A commit references this bug: Author: dchagin Date: Sat Jul 15 08:27:23 UTC 2017 New revision: 321007 URL: https://svnweb.freebsd.org/changeset/base/321007 Log: MFC r320595: Add support for musl consumers to the Linuxulator. PR: 213809 Submitted by: Yonas Yanfa (for amd64) Reported by: Yonas Yanfa Relnotes: yes Changes: _U stable/11/ stable/11/sys/amd64/linux/linux_sysvec.c stable/11/sys/amd64/linux32/linux32_sysvec.c stable/11/sys/i386/linux/linux_sysvec.c
Thanks