Where did docker-containers go?

Hey guys

It seems like the docker-containers options was removed in nixos-20.09 and unstable?
I cannot find any alternative or a motivation for this removal though. Does anyone know what happened?

Thanks!

1 Like

In the release notes you can find these 3 bulletpoints:

  • There is a new module for Podman( virtualisation.podman ), a drop-in replacement for the Docker command line.
  • The new virtualisation.containers module manages configuration shared by the CRI-O and Podman modules.
  • Declarative Docker containers are renamed from docker-containers to virtualisation.oci-containers.containers . This is to make it possible to use podman instead of docker .
2 Likes

Thanks, brings me one step further, but looking on options#containers (or anywhere else for that matter) still isn’t really clear.

E.g.: I want to declaratively define containers but use podman. So I would think that I’d have to use virtualisation.containers for that, but I would expect to have the same options as virtualisation.oci-containers.containers, since podman has almost the same features as docker (and you obviously need all those settings offered in oci-containers to actually define your container parameters). But virtualisation.containers actually only seems to cover some settings which you normally specify (podman config) in /etc/containers, but nothing related to individual container declarations.

But, this doesn’t seem to be the case, so how does one declaratively specify podman containers and (auto) run them as a service?

Or did I understand it wrong and does virtualisation.oci-containers.containers use podman instead of docker if virtualisation.podman.enable = true?

Also (just for reference), it took me a while (being a nixnoob) to see that the “toplevel” containers option (for nixos-containers) is in fact a way to leverage the inherent “containment” capability of nix to start one or more packages in an orchestrated fashion with their isolated configs, thereby achieving the same as docker/podman containers in a completely different way. Which is really cool (but no solution if you just want to run a container from e.g. docker hub).

ppenguin via NixOS Discourse nixos1@discoursemail.com writes:

Or did I understand it wrong and does
virtualisation.oci-containers.containers use podman instead of
docker if
virtualisation.podman.enable = true?

This and virtualisation.oci-containers.backend = "podman";
should enable things for you.

1 Like

@afontaine Thanks for the fast reply!
I will check it out. (Or in this case (my goal is to install iRedMail on my first nixos VPS), if I can muster the time and curiosity, I might even write a native nix container def for iRedMail :thinking:).

1 Like

my goal is to install iRedMail on my first nixos VPS

You may also want to look at simple-nixos-mailserver if you haven’t already.

@ero-sennin

Thanks, I had seen it but figured iRedMail could be more mature/feature-rich. But while I managed quite easily to start the container using the above, I found the open offering (without the closed/paid extensions) lacking in documentation and user-friendliness for configuration.

So now I may go for either simple-nixos-mailserver or nixcloud-webservices. What attracts me to the latter is that it would fit in well with an nginx reverse proxy which I’m also planning on that host, but they seem pretty similar.

Is there any experience which of the two I should prefer? (I was a bit surprised that one would go through the trouble of making a second implementation which is so very similar to an existing one, this mainly prompts this question).