{"id":22762330,"url":"https://github.com/computermouth/qemu-static-conf","last_synced_at":"2025-04-14T20:42:14.937Z","repository":{"id":99630025,"uuid":"97093384","full_name":"computermouth/qemu-static-conf","owner":"computermouth","description":"Docker cross-architecture builds without putting qemu-*-static in the image","archived":false,"fork":false,"pushed_at":"2017-08-30T23:44:37.000Z","size":4,"stargazers_count":43,"open_issues_count":2,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T08:51:17.602Z","etag":null,"topics":["cross","docker","qemu-arm","qemu-user-static"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/computermouth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-13T07:29:26.000Z","updated_at":"2024-08-14T02:29:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"b9a87fe6-d70f-46e3-873c-2b5e73d4d39b","html_url":"https://github.com/computermouth/qemu-static-conf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/computermouth%2Fqemu-static-conf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/computermouth%2Fqemu-static-conf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/computermouth%2Fqemu-static-conf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/computermouth%2Fqemu-static-conf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/computermouth","download_url":"https://codeload.github.com/computermouth/qemu-static-conf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248959937,"owners_count":21189970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cross","docker","qemu-arm","qemu-user-static"],"created_at":"2024-12-11T10:07:32.097Z","updated_at":"2025-04-14T20:42:14.932Z","avatar_url":"https://github.com/computermouth.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"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)\n\n### How do I know if I need them?\n\nRun the following command:\n\n`systemctl status systemd-binfmt`\n\nIf you see output like the following [note the `start condition failed` part]:\n\n```\ncomputermouth@debian:~$ systemctl status systemd-binfmt\n● systemd-binfmt.service - Set Up Additional Binary Formats\n   Loaded: loaded (/lib/systemd/system/systemd-binfmt.service; static; vendor preset: enabled)\n   Active: inactive (dead) since Thu 2017-07-13 00:06:51 PDT; 5s ago\nCondition: start condition failed at Thu 2017-07-13 00:06:51 PDT; 5s ago\n           ├─ ConditionDirectoryNotEmpty=|/lib/binfmt.d was not met\n           ├─ ConditionDirectoryNotEmpty=|/usr/lib/binfmt.d was not met\n           ├─ ConditionDirectoryNotEmpty=|/usr/local/lib/binfmt.d was not met\n           ├─ ConditionDirectoryNotEmpty=|/etc/binfmt.d was not met\n           └─ ConditionDirectoryNotEmpty=|/run/binfmt.d was not met\n     Docs: man:systemd-binfmt.service(8)\n           man:binfmt.d(5)\n           https://www.kernel.org/doc/Documentation/binfmt_misc.txt\n  Process: 12402 ExecStart=/lib/systemd/systemd-binfmt (code=exited, status=0/SUCCESS)\n Main PID: 12402 (code=exited, status=0/SUCCESS)\n      CPU: 0\n\n```\n\n...you will need the files here in one of the above directories. Personally, I've been using them in `/lib/binfmt.d`.\n\n### How do I install?\n\n```\ngit clone https://github.com/computermouth/qemu-static-conf.git\nsudo mkdir -p /lib/binfmt.d\nsudo cp qemu-static-conf/*.conf /lib/binfmt.d/\nsudo systemctl restart systemd-binfmt.service\n```\n\n### How do I test if it's working\n\nNOTE: 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/).\n\n```\necho -e \"FROM arm32v7/debian:stretch-slim\\n\\nRUN echo 'it works'\" \u003e Dockerfile\ndocker build .\n```\n\nIf the container succeeds to build without error, you're good to go!\n\n### Why isn't this built into Debian/Ubuntu (but it is in Fedora)?\n\nI'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\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomputermouth%2Fqemu-static-conf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomputermouth%2Fqemu-static-conf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomputermouth%2Fqemu-static-conf/lists"}