-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
nixos/podman: Add docker socket support #123841
Conversation
This comment has been minimized.
This comment has been minimized.
@GrahamcOfBorg test podman podman-tls-ghostunnel |
Two quick comments: Can we test docker compose? Can you add yourself as a maintainer for the podman compat test (or add yourself to the podman team)? I'll be able to do a proper review later today. |
That will be a nice addition. I have to do more (unplanned) work on arion as well, so let's not delay this PR.
Done.
Thanks, but sadly I'm not in a position to commit to more maintenance responsibilities. |
"L! /run/docker.sock - - - - /run/podman/podman.sock" | ||
]; | ||
|
||
services.ghostunnel = lib.mkIf cfg.networkSocket.enable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the ghostunnel
stuff here and in the test, seems odd to add have the implementation of a specific proxy in the podman module. Can't it live somewhere else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the
ghostunnel
stuff here
Good point. I've moved it into a separate module and it's much cleaner now.
I've also added myself as a maintainer there.
and in the test
I'm a hesitant to split the tests up further, because of the VM startup overhead. I'm not too concerned about Hydra (It's like 10 to 20 seconds perhaps) but about running the tests locally.
I did create a new test for the socket-based compatibility stuff, because the "core" podman tests in nixosTests.podman
must work without the compatibility stuff.
seems odd to add have the implementation of a specific proxy in the podman module. Can't it live somewhere else?
Having a module make an implementation choice isn't anything new. For instance, we have acme modules and options that are implemented by the lego
client. In other words, it's ok for a module to be opinionated. I don't care about the choice of TLS server and I don't think swapping it out would cause any issues.
Sorry but that isn't what I meant. Why can't this be handled by generic method via ghostunnel without the needing a podman.networksocket option? |
It adds value. You don't have to look up the details of where the socket is, how the ghostunnel syntax works, etc. It provides a single open source solution for this small problem. It also makes the possibility of exposing Podman via TLS discoverable in the NixOS option docs. |
I'm a strong no on this as it is, sorry. I don't agree with the opinionated config and having this much of the implementation under the podman module. |
Is there some way the |
That's possible. You could even use the module system's type merging to make it open for extension. I'd lay it out as follows:
Providing other server integrations will be a matter of adding another module similar to the If that sounds ok to you, I'll implement it that way. |
That sounds reasonable to me. @zowoq How does that sound? |
This sound okay if the I'll also ask that the test be split so that the core / first-party local socket be tested separately from the non-core / third party network socket. I'm fine with the local tests being added to the current core podman tests, we should also add a TODO for including docker compose test as part of the core tests as well. |
Done, but the default is unset rather than |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of nits but otherwise this looks okay, thanks for making the changes. I would like to wait a couple of days before we merge to allow the other podman maintainers a chance to comment.
Also, could you please clean up the history on this branch before this is merged? With this spread over eleven commits it's adding a bit of unnecessary noise to these files.
environment.systemPackages = [ | ||
# Installs the docker _client_ only | ||
# Normally, you'd want `virtualisation.docker.enable = true;`. | ||
pkgs.docker |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened #124561 so we can use a client only package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question, feel free to merge after it's resolved.
Edit: Needs to be rebased as well, sorry.
environment.systemPackages = [ | ||
# Installs the docker _client_ only | ||
# Normally, you'd want `virtualisation.docker.enable = true;`. | ||
pkgs.docker |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change this to pkgs.docker-client
?
🎉 Thank you so much @zowoq! |
@roberth Do you happen to recall why the tmpfiles rule is configured to only run on boot? ( |
I don't recall and it may well be a mistake. |
Motivation for this change
Podman supports the Docker API.
Enable more compatibility options to use podman as a docker replacement.
podman
groupI've successfully deployed with
docker-compose
via these Docker interfaces all the way to the Podman socket.It's a promising solution since Podman promises systemd container support and Docker has regressed in this regard.
cc @NixOS/podman
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)