-
-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is virtualisation.docker.enable possible for macOS? #112
Comments
The main issue for running docker from binaries in the nix store is their requirements. Although we have a usable docker client in nixpkgs for macOS, we miss a running backend for docker-machine that doesn't conflict with the purity requirements of the nix store. I have tried multiple approaches in the past and the state of the union is still wait and watch and use docker for mac with the nixpkgs docker client, e.g.:
|
Firstly the docker daemon and containers only run on x86_64-linux so those need to run in a vm. This is what Docker.app does for you and something we could reproduce with linuxkit. However there's a bunch of extra functionality like exposing ports and sharing files that also work with Docker.app and would be much harder to reproduce. |
Thank you two for this thorough explanation, it is very useful to understand these constraints! This seems to be a difficult endeavor indeed … 😞 |
I don't think running the daemon in a vm with linuxkit would be that hard to implement. I just don't know how much sense that makes given the limitations that would have compared to an official install. |
if linuxkit ever made it to master, it would have been a good solution afaik. |
It is AFAIK. |
My use of Docker is kind of limited, I mostly want to use it for projects that don't run within a Nix shell anymore (due to oooold versions of some software), for everything else I just use a Nix shell. I was interested in installing Docker through NixPkgs so I could add it as a dependency to a project and everyone on the team would get the right version, but then I learned that it has to be a daemon, which brought me here 😄 So in the end it's more of a personal preference that I would like to not have to worry about bringing my OS into the right state to run a project, but of course, the official install works. |
@LnL7 you are right linuxkit is in master, i meant linuxkit-builder, which still an open PR (NixOS/nixpkgs#29628), but still maintained under https://github.com/nix-community/linuxkit-nix |
I know the thread is a bit old, but a workaround today is to use podman (already in nixpkgs):
|
Cool, so you can just |
Seems it's a bit broken, the build assumes a homebrew environment and looks for But that should probably be in a new issue Edit: #432 |
Trying podman I had this issue:
But in case it can help anyone, I found that colima (available in nixpkgs) does work as a replacement of Docker Desktop (for the VM and docker daemon), and makes it possible to use the docker CLI: NixOS/nixpkgs#47201 (comment) |
I found that NixOS has
virtualisation.docker.enable = true
to enable Docker, but that nix-darwin does not. I was thinking that this was maybe just not on the road map yet, but from what I found it seems not possible to run Docker on macOS purely from NixPkgs, i.e. everyone seems to be using the Docker app.I was wondering whether there are technical or legal hurdles or whether it's “just” (I know 😅) that no one is maintaining this. I saw that nix-darwin has, for example, Postgres daemon support and that you maintain nix-docker, so I assume there must be a bigger issue?
The text was updated successfully, but these errors were encountered: