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.
This commit is contained in:
Vincent Ambo 2019-11-09 14:30:48 +00:00 committed by Vincent Ambo
parent 9a8abeff97
commit 104c930040
2 changed files with 5 additions and 3 deletions

View file

@ -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

View file

@ -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