Skip to content

Commit 6d0f174

Browse files
authored
Reduce maxLayers to 70 in docker build
The nixos/nix docker image is built using `buildLayeredImage`, which spreads the nix store over a configured number of layers. This number was set to create an image with 100 layers. Because there is a limit of (typically) 127 layers in AUFS, this only left 27 layers to build on top. At the same time, nearly half of the created layers were only <100kb in size, many even <10kb, negating the intended advantage in cachability. This commit moves the tradeoff a bit by reducing the number of layers to 70. Layer sizes for the 2.28.3 nixos/nix image: https://hub.docker.com/layers/nixos/nix/2.28.3/images/sha256-d078d7153763895fce17c5fbbdeb86fcfcac414ca0ba875d413c1df57be19931
1 parent 1e822bd commit 6d0f174

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docker.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
channelName ? "nixpkgs",
88
channelURL ? "https://nixos.org/channels/nixpkgs-unstable",
99
extraPkgs ? [ ],
10-
maxLayers ? 100,
10+
maxLayers ? 70,
1111
nixConf ? { },
1212
flake-registry ? null,
1313
uid ? 0,

0 commit comments

Comments
 (0)