Docker: Difference between revisions

From NixOS Wiki
imported>Makefu
No edit summary
imported>Makefu
No edit summary
Line 8: Line 8:
   ...
   ...
   virtualisation.docker.enable = true;
   virtualisation.docker.enable = true;
}
</syntaxHighlight>
Adding users to the <code>docker</code> group will provide them access to the socket:
<syntaxHighlight lang="nix">
{
  users.users.<myuser>.extraGroups = [ "docker" ];
}
}
</syntaxHighlight>
</syntaxHighlight>

Revision as of 12:41, 7 September 2017

Enabling the docker service

Inside your configuration.nix:

{
  ...
  virtualisation.docker.enable = true;
}

Adding users to the docker group will provide them access to the socket:

{
  users.users.<myuser>.extraGroups = [ "docker" ];
}

Building a docker image with nixpkgs

There is an entry for dockerTools in the nixpkgs manual for reference. In the nixpkgs repo some examples can be found.