Docker: Difference between revisions
imported>Makefu No edit summary |
imported>Mic92 nix container images. |
||
Line 23: | Line 23: | ||
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]. | 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]. | ||
== Container images with nix == | |||
While <code>dockerTools</code> allows to build lightweight containers, it requires <code>nix</code> to be installed on the host system. An alternative are [https://github.com/LnL7/nix-docker docker images] with nix preinstalled, maintained by LnL7. | |||
[[Category:Guide]] | [[Category:Guide]] |
Revision as of 15:02, 12 April 2018
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.
Container images with nix
While dockerTools
allows to build lightweight containers, it requires nix
to be installed on the host system. An alternative are docker images with nix preinstalled, maintained by LnL7.