diff options
author | Vincent Ambo <tazjin@google.com> | 2019-11-09T14·30+0000 |
---|---|---|
committer | Vincent Ambo <github@tazj.in> | 2019-11-09T15·35+0000 |
commit | 104c930040ab081f6e24aad95a7df71339d8e6d4 (patch) | |
tree | 88805b9fa7bc82bc93ce502e8174b163986794d0 | |
parent | 9a8abeff977cfb488073c1f338df0821021d41ab (diff) |
chore(build): Use significantly fewer layers for Nixery itself
Nixery itself is built with the buildLayeredImage system, which takes some time to create large numbers of layers. This adjusts the default number of image layers from 96 to 20. Additionally Nixery's image is often loaded with `docker load -i`, which ignores layer cache hits anyways. Additionaly the CI build is configured to use only 1, which speeds up CI runs.
-rw-r--r-- | tools/nixery/.travis.yml | 2 | ||||
-rw-r--r-- | tools/nixery/default.nix | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/tools/nixery/.travis.yml b/tools/nixery/.travis.yml index 72b2a657b34b..b0a2b3f997f9 100644 --- a/tools/nixery/.travis.yml +++ b/tools/nixery/.travis.yml @@ -15,7 +15,7 @@ before_script: - cachix use nixery script: - test -z $(gofmt -l server/ build-image/) - - nix-build | cachix push nixery + - nix-build --arg maxLayers 1 | cachix push nixery # This integration test makes sure that the container image built # for Nixery itself runs fine in Docker, and that images pulled diff --git a/tools/nixery/default.nix b/tools/nixery/default.nix index af1ec904bf25..44ac7313adc7 100644 --- a/tools/nixery/default.nix +++ b/tools/nixery/default.nix @@ -14,7 +14,8 @@ { pkgs ? import <nixpkgs> { } , preLaunch ? "" -, extraPackages ? [] }: +, extraPackages ? [] +, maxLayers ? 20 }: with pkgs; @@ -92,7 +93,8 @@ in rec { in dockerTools.buildLayeredImage { name = "nixery"; config.Cmd = [ "${nixery-launch-script}/bin/nixery" ]; - maxLayers = 96; + + inherit maxLayers; contents = [ bashInteractive cacert |