Docker: Difference between revisions
imported>SIGSTKFLT m consider using rootless mode below |
→Using Nix in containers: - NixOS in containers using Arion |
||
(5 intermediate revisions by 4 users not shown) | |||
Line 114: | Line 114: | ||
More examples can be found in the [https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/docker/examples.nix nixpkgs] repo. | More examples can be found in the [https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/docker/examples.nix nixpkgs] repo. | ||
Also check out the excellent article by [ | Also check out the excellent article by [https://lucabrunox.github.io/2016/04/cheap-docker-images-with-nix_15.html lethalman] about building minimal docker images with nix. | ||
=== Reproducible image dates === | === Reproducible image dates === | ||
Line 148: | Line 148: | ||
1x00ks05cz89k3wc460i03iyyjr7wlr28krk7znavfy2qx5a0hfd | 1x00ks05cz89k3wc460i03iyyjr7wlr28krk7znavfy2qx5a0hfd | ||
</syntaxHighlight> | </syntaxHighlight> | ||
=== Directly Using Nix in Image Layers === | |||
Instead of copying Nix packages into Docker image layers, Docker can be configured to directly utilize the <code>nix-store</code> by integrating with [https://github.com/pdtpartners/nix-snapshotter nix-snapshotter]. | |||
This will significantly reduce data duplication and the time it takes to pull images. | |||
== Docker Compose with Nix == | == Docker Compose with Nix == | ||
Line 185: | Line 191: | ||
* [https://hub.docker.com/r/nixos/nix/tags nixos/nix] (official) | * [https://hub.docker.com/r/nixos/nix/tags nixos/nix] (official) | ||
* [https://hub.docker.com/r/nixpkgs/nix nixpkgs/nix] (built from https://github.com/nix-community/docker-nixpkgs) | * [https://hub.docker.com/r/nixpkgs/nix nixpkgs/nix] (built from https://github.com/nix-community/docker-nixpkgs) | ||
NixOS can be run in containers [https://docs.hercules-ci.com/arion/#_nixos_run_full_os using Arion]. | |||
= See also = | = See also = | ||
Line 190: | Line 197: | ||
[[Workgroup:Container]] | [[Workgroup:Container]] | ||
Alternatively you can use [ | Alternatively you can use [[Podman | podman]]. | ||
[[Category:Cookbook]] | [[Category:Cookbook]] | ||
[[Category: | [[Category:Software]] | ||
[[Category: | [[Category:Server]] | ||
[[Category: | [[Category:Container]] | ||