Docker: Difference between revisions

Jooooscha (talk | contribs)
Clean up a bit and improve the Docker Compose section
Jooooscha (talk | contribs)
m Fix: change page-titles to headings
Line 1: Line 1:
[https://docker.com Docker] is a utility to pack, ship and run any application as a lightweight container.  
[https://docker.com Docker] is a utility to pack, ship and run any application as a lightweight container.  
= Docker on NixOS =


== Installation ==
== Installation ==
Line 68: Line 66:
See [https://mynixos.com/options/virtualisation.oci-containers.containers.%3Cname%3E oci-containers] for further options
See [https://mynixos.com/options/virtualisation.oci-containers.containers.%3Cname%3E oci-containers] for further options


= Creating images with Nix =
== Creating images with Nix ==


=== Building a docker image with nixpkgs ===
=== Building a docker image with nixpkgs ===
Line 208: Line 206:
</syntaxhighlight>The <code>-runtime</code> flag specifies the runtime. Here, we select <code>docker</code>. Options are <code>podman</code> and <code>docker</code>. The default is <code>podman</code>
</syntaxhighlight>The <code>-runtime</code> flag specifies the runtime. Here, we select <code>docker</code>. Options are <code>podman</code> and <code>docker</code>. The default is <code>podman</code>


= Using Nix in containers =
== Using Nix in containers ==
 
While [https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-dockerTools dockerTools] allows to build lightweight containers, it requires <code>nix</code> to be installed on the host system. An alternative are docker images with nix preinstalled:
While [https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-dockerTools dockerTools] allows to build lightweight containers, it requires <code>nix</code> to be installed on the host system. An alternative are docker images with nix preinstalled:


Line 232: Line 229:
</syntaxhighlight>Restarting, the container or Docker might be required.
</syntaxhighlight>Restarting, the container or Docker might be required.


= See also =
== See also ==
 
[[Workgroup:Container]]
[[Workgroup:Container]]