docker-nixpkgs
docker-nixpkgs copied to clipboard
Images don't work on macos with podman
I tried to run different images on a macbook and got errors about a problem with the Exec format.
I didn't inspect the image layout so I don't know if the binaries are not put in the correct directory or if docker and podman understand differently the CMD instruction
Even a basic podman run -ti --rm nixpkgs/bash bash doesn't work
In fact the error is about the architecture. My computer is using m1 so an aarch64 architecture and the versions published on docker hub is only on x86-64
It works for me, but you need to tell podman machine the architecture of the image with --arch amd64
:
podman run --arch amd64 -ti --rm nixpkgs/bash
#=> bash-5.1#
It might be that this is a recent addition to podman. Podman machine is still running aarch64 but emulates amd64 when asked to.
That said, it would actually be great to have these docker-nixpkgs images generated for aarch64-linux too, so they could run virtualized rather than emulated on Apple Silicon. I've managed to create a nix remote-builder using docker.io/nixpkgs/nix-flakes
as a base and running it on podman on my M1, but it's of course terribly slow. While I do need to produce images for x86_64-linux eventually, being able to produce them for aarch64-linux in development and testing, and only build them for x86_64 when it's time to ship, would make an acceptable workflow. And for that I need a aarch64-linux remote-builder as well.
Opened #46 to track the aarch64 requirement