Search code examples
dockerdaemonnixos

dockerd not running on nixos


I installed docker on nixos, using:

nix-env -i docker

after that, dockerd was not running, so I started the daemon manually with:

dockerd

and in the logs, I see:

WARN[2019-06-26T01:02:31.784701442Z] could not change group /var/run/docker.sock to docker: group docker not found

should I care about this warning?


Solution

  • When installing docker on NixOS, it's best to enable it in the NixOS configuration. Doing so will install docker as a system service.

    Snippet for /etc/nixos/configuration.nix:

    virtualisation.docker.enable = true;
    
    # ...
    
    users.users.YOU = { # merge this with your unix user definition, "YOU" is for illustration
      isNormalUser = true;
      # ...
      extraGroups = [
        # ...
        "docker"
      ];
    };