├── README.md ├── qemu-aarch64-static.conf ├── qemu-alpha-static.conf ├── qemu-arm-static.conf ├── qemu-armeb-static.conf ├── qemu-cris-static.conf ├── qemu-m68k-static.conf ├── qemu-microblaze-static.conf ├── qemu-microblazeel-static.conf ├── qemu-mips-static.conf ├── qemu-mips64-static.conf ├── qemu-mips64el-static.conf ├── qemu-mipsel-static.conf ├── qemu-ppc-static.conf ├── qemu-ppc64-static.conf ├── qemu-ppc64abi32-static.conf ├── qemu-s390x-static.conf ├── qemu-sh4-static.conf ├── qemu-sh4eb-static.conf ├── qemu-sparc-static.conf ├── qemu-sparc32plus-static.conf └── qemu-sparc64-static.conf /README.md: -------------------------------------------------------------------------------- 1 | The latest versions of Docker for Windows and Docker for Mac can build non-native architecture containers. I reached out to Anil Madhavapeddy, an engineer at Docker, asking about why it wasn't the case on Linux, turns out [Linux can too](https://twitter.com/avsm/status/885028269397090306), there's just an issue with some distributions of qemu-user-static that's disallowing the functionality. These files enable (likely among other things) the ability to build `arm32v7/*` Docker images on a Linux host of a different architecture without putting qemu-*-static binaries in the image itself. (Only tested on Debian 9) 2 | 3 | ### How do I know if I need them? 4 | 5 | Run the following command: 6 | 7 | `systemctl status systemd-binfmt` 8 | 9 | If you see output like the following [note the `start condition failed` part]: 10 | 11 | ``` 12 | computermouth@debian:~$ systemctl status systemd-binfmt 13 | ● systemd-binfmt.service - Set Up Additional Binary Formats 14 | Loaded: loaded (/lib/systemd/system/systemd-binfmt.service; static; vendor preset: enabled) 15 | Active: inactive (dead) since Thu 2017-07-13 00:06:51 PDT; 5s ago 16 | Condition: start condition failed at Thu 2017-07-13 00:06:51 PDT; 5s ago 17 | ├─ ConditionDirectoryNotEmpty=|/lib/binfmt.d was not met 18 | ├─ ConditionDirectoryNotEmpty=|/usr/lib/binfmt.d was not met 19 | ├─ ConditionDirectoryNotEmpty=|/usr/local/lib/binfmt.d was not met 20 | ├─ ConditionDirectoryNotEmpty=|/etc/binfmt.d was not met 21 | └─ ConditionDirectoryNotEmpty=|/run/binfmt.d was not met 22 | Docs: man:systemd-binfmt.service(8) 23 | man:binfmt.d(5) 24 | https://www.kernel.org/doc/Documentation/binfmt_misc.txt 25 | Process: 12402 ExecStart=/lib/systemd/systemd-binfmt (code=exited, status=0/SUCCESS) 26 | Main PID: 12402 (code=exited, status=0/SUCCESS) 27 | CPU: 0 28 | 29 | ``` 30 | 31 | ...you will need the files here in one of the above directories. Personally, I've been using them in `/lib/binfmt.d`. 32 | 33 | ### How do I install? 34 | 35 | ``` 36 | git clone https://github.com/computermouth/qemu-static-conf.git 37 | sudo mkdir -p /lib/binfmt.d 38 | sudo cp qemu-static-conf/*.conf /lib/binfmt.d/ 39 | sudo systemctl restart systemd-binfmt.service 40 | ``` 41 | 42 | ### How do I test if it's working 43 | 44 | NOTE: You will need to `sudo docker` below if you haven't set up the appropriate [permissions](https://docs.docker.com/engine/installation/linux/linux-postinstall/). 45 | 46 | ``` 47 | echo -e "FROM arm32v7/debian:stretch-slim\n\nRUN echo 'it works'" > Dockerfile 48 | docker build . 49 | ``` 50 | 51 | If the container succeeds to build without error, you're good to go! 52 | 53 | ### Why isn't this built into Debian/Ubuntu (but it is in Fedora)? 54 | 55 | I'm not sure, that systemd service is distributed with them out of the box, but Fedora supplies these files with their qemu-user-static package, while Debian and Ubuntu don't. I've submitted a bug report here: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=868217 56 | -------------------------------------------------------------------------------- /qemu-aarch64-static.conf: -------------------------------------------------------------------------------- 1 | :qemu-aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00:\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfe\xff\xff\xff:/usr/bin/qemu-aarch64-static:F 2 | -------------------------------------------------------------------------------- /qemu-alpha-static.conf: -------------------------------------------------------------------------------- 1 | :qemu-alpha:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90:\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfe\xff\xff\xff:/usr/bin/qemu-alpha-static:F 2 | -------------------------------------------------------------------------------- /qemu-arm-static.conf: -------------------------------------------------------------------------------- 1 | :qemu-arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:F 2 | -------------------------------------------------------------------------------- /qemu-armeb-static.conf: -------------------------------------------------------------------------------- 1 | :qemu-armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xfe\xff\xff:/usr/bin/qemu-armeb-static:F 2 | -------------------------------------------------------------------------------- /qemu-cris-static.conf: -------------------------------------------------------------------------------- 1 | :qemu-cris:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x4c\x00:\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfe\xff\xff\xff:/usr/bin/qemu-cris-static:F 2 | -------------------------------------------------------------------------------- /qemu-m68k-static.conf: -------------------------------------------------------------------------------- 1 | :qemu-m68k:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x04:\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xfe\xff\xff:/usr/bin/qemu-m68k-static:F 2 | -------------------------------------------------------------------------------- /qemu-microblaze-static.conf: -------------------------------------------------------------------------------- 1 | :qemu-microblaze:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\xba\xab:\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xfe\xff\xff:/usr/bin/qemu-microblaze-static:F 2 | -------------------------------------------------------------------------------- /qemu-microblazeel-static.conf: -------------------------------------------------------------------------------- 1 | :qemu-microblazeel:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xab\xba:\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfe\xff\xff\xff:/usr/bin/qemu-microblazeel-static:F 2 | -------------------------------------------------------------------------------- /qemu-mips-static.conf: -------------------------------------------------------------------------------- 1 | :qemu-mips:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xfe\xff\xff:/usr/bin/qemu-mips-static:F 2 | -------------------------------------------------------------------------------- /qemu-mips64-static.conf: -------------------------------------------------------------------------------- 1 | :qemu-mips64:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xfe\xff\xff:/usr/bin/qemu-mips64-static:F 2 | -------------------------------------------------------------------------------- /qemu-mips64el-static.conf: -------------------------------------------------------------------------------- 1 | :qemu-mips64el:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfe\xff\xff\xff:/usr/bin/qemu-mips64el-static:F 2 | -------------------------------------------------------------------------------- /qemu-mipsel-static.conf: -------------------------------------------------------------------------------- 1 | :qemu-mipsel:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfe\xff\xff\xff:/usr/bin/qemu-mipsel-static:F 2 | -------------------------------------------------------------------------------- /qemu-ppc-static.conf: -------------------------------------------------------------------------------- 1 | :qemu-ppc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xfe\xff\xff:/usr/bin/qemu-ppc-static:F 2 | -------------------------------------------------------------------------------- /qemu-ppc64-static.conf: -------------------------------------------------------------------------------- 1 | :qemu-ppc64:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15:\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xfe\xff\xff:/usr/bin/qemu-ppc64-static:F 2 | -------------------------------------------------------------------------------- /qemu-ppc64abi32-static.conf: -------------------------------------------------------------------------------- 1 | :qemu-ppc64abi32:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15:\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xfe\xff\xff:/usr/bin/qemu-ppc64abi32-static:F 2 | -------------------------------------------------------------------------------- /qemu-s390x-static.conf: -------------------------------------------------------------------------------- 1 | :qemu-s390x:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16:\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xfe\xff\xff:/usr/bin/qemu-s390x-static:F 2 | -------------------------------------------------------------------------------- /qemu-sh4-static.conf: -------------------------------------------------------------------------------- 1 | :qemu-sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfe\xff\xff\xff:/usr/bin/qemu-sh4-static:F 2 | -------------------------------------------------------------------------------- /qemu-sh4eb-static.conf: -------------------------------------------------------------------------------- 1 | :qemu-sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xfe\xff\xff:/usr/bin/qemu-sh4eb-static:F 2 | -------------------------------------------------------------------------------- /qemu-sparc-static.conf: -------------------------------------------------------------------------------- 1 | :qemu-sparc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xfe\xff\xff:/usr/bin/qemu-sparc-static:F 2 | -------------------------------------------------------------------------------- /qemu-sparc32plus-static.conf: -------------------------------------------------------------------------------- 1 | :qemu-sparc32plus:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x12:\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xfe\xff\xff:/usr/bin/qemu-sparc32plus-static:F 2 | -------------------------------------------------------------------------------- /qemu-sparc64-static.conf: -------------------------------------------------------------------------------- 1 | :qemu-sparc64:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2b:\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xfe\xff\xff:/usr/bin/qemu-sparc64-static:F 2 | --------------------------------------------------------------------------------