dockerd not running on nixos
Asked Answered
S

3

11

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?

Salade answered 26/6, 2019 at 1:32 Comment(0)
M
18

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"
  ];
};
Mt answered 26/6, 2019 at 9:27 Comment(3)
I am pretty sure (but less than 100%) you will need to create the docker group as well.Alderete
The docker module creates the group for you: github.com/NixOS/nixpkgs/blob/…Mt
even when I add extraGroups if I run groups on a terminal after restarting (and running nixos-rebuild switch) the docker group is not listed under my userDede
G
3

created a group docker. Docker needs that user group to start as a service.

Gurgitation answered 26/6, 2019 at 7:47 Comment(0)
I
1

Make sure to restart your computer, and not just logout-login, to actually make sudo-less docker work.

Inwrap answered 27/8, 2023 at 18:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.