Docker: Difference between revisions

From NixOS Wiki
imported>Makefu
No edit summary
imported>Makefu
No edit summary
Line 21: Line 21:
There is [https://nixos.org/nixpkgs/manual/#sec-pkgs-dockerTools an entry for dockerTools in the nixpkgs manual ] for reference.
There is [https://nixos.org/nixpkgs/manual/#sec-pkgs-dockerTools an entry for dockerTools in the nixpkgs manual ] for reference.
In the nixpkgs repo some [https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/docker/examples.nix examples] can be found.
In the nixpkgs repo some [https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/docker/examples.nix examples] can be found.
Also check out the excellent article by lethalman about [http://lethalman.blogspot.de/2016/04/cheap-docker-images-with-nix_15.html building minimal docker images with nix].


[[Category:Guide]]
[[Category:Guide]]

Revision as of 09:47, 7 October 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.

Also check out the excellent article by lethalman about building minimal docker images with nix.