Docker: Difference between revisions

imported>CardboardTurkey
m (As of 22.05 rootless docker can be used instead of Podman)
imported>Onny
(Minor cleanup)
Line 1: Line 1:
{{Expansion|This article is incomplete.}}
[https://docker.com Docker] is a utility to pack, ship and run any application as a lightweight container.  


== Enabling the docker service ==
== Installation ==


Inside your <code>configuration.nix</code>:
Inside your <code>configuration.nix</code>:


<syntaxHighlight lang=nix>
<syntaxHighlight lang=nix>
{
virtualisation.docker.enable = true;
  ...
  virtualisation.docker.enable = true;
  ...
}
</syntaxHighlight>
</syntaxHighlight>


Line 16: Line 12:


Adding users to the <code>docker</code> group will provide them access to the socket:
Adding users to the <code>docker</code> group will provide them access to the socket:
{{Warning|Beware that the docker group membership is effectively [https://github.com/moby/moby/issues/9976 equivalent to being root]!}}
<syntaxHighlight lang=nix>
<syntaxHighlight lang=nix>
{
users.users.<myuser>.extraGroups = [ "docker" ];
  users.users.<myuser>.extraGroups = [ "docker" ];
}
</syntaxHighlight>
</syntaxHighlight>
{{note|
'''BEWARE''' that the docker group membership is effectively [https://github.com/moby/moby/issues/9976 equivalent to being root]!
}}


== Building a docker image with nixpkgs ==
== Building a docker image with nixpkgs ==