Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Cannot build useful docker images on OS X (darwin) #16696
I am trying to build docker images using nix on my Macbook Pro, running Darwin. When I try to do so, nix tries to build
Normally, I use the docker-machine VM for building images. The
I tried to find documentation on how to build docker images on OS X via the docker-machine VM, but couldn't find anything.
Steps to reproduce
And then running
When I add
Thanks for replying. I currently use a similar work-around.
However, the bug still stands:
@garbas there's no reason for a specific assertion. If a package is not supported on darwin there's little I can do, and I don't want to add extra friendly magic error messages. It's quite clear there, linux-pam is not supported. Yet, it's perfectly possible to build images on OS X without involving PAM stuff, pretty limited but possible.
@jml The main difference between our dockerTools and docker itself is that with dockerTools we take advantage of Nix build artifacts outside of the container. That means linux-pam is supposed to be available on OS X, which isn't the case obviously. While Docker builds its stuff within the container.
OK, I think I understand now. dockerTools re-implements
Even if the PAM thing got sorted out, dockerTools would still not be useful on OS X, because it would produce darwin binaries that couldn't run inside a Linux container.
I still want to use Nix expressions to build Docker images while running on OS X. I still think that's a laudable goal.
Would it be possible to make something that provides a similar interface to dockerTools, but uses the
I wouldn't say
I'd like to make something like that easier to use for OSX users, but it should get you reasonably transparent cross-builds like that today.
Using a remote builder as suggested by @copumpkin above gets closer, but not to the point of successful builds.
After configuring an appropriate builder (either with @LnL7's tools or
...thus fails with:
(...as also brought up on Unix & Linux StackExchange at https://unix.stackexchange.com/questions/470420/bash-cannot-execute-binary-file-during-nix-dockertools-cross-build-from-macos).