Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 696
Alexander Mills Avatar asked Jun 26 '19 01:06

Alexander Mills


2 Answers

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"
  ];
};
like image 122
Robert Hensing Avatar answered Nov 06 '22 23:11

Robert Hensing


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

like image 3
deosha Avatar answered Nov 07 '22 00:11

deosha