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 5204283b46
commit 358d37ef7a
2 changed files with 5 additions and 3 deletions

View File

@ -15,7 +15,7 @@ before_script:
- cachix use nixery - cachix use nixery
script: script:
- test -z $(gofmt -l server/ build-image/) - 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 # This integration test makes sure that the container image built
# for Nixery itself runs fine in Docker, and that images pulled # for Nixery itself runs fine in Docker, and that images pulled

View File

@ -14,7 +14,8 @@
{ pkgs ? import <nixpkgs> { } { pkgs ? import <nixpkgs> { }
, preLaunch ? "" , preLaunch ? ""
, extraPackages ? [] }: , extraPackages ? []
, maxLayers ? 20 }:
with pkgs; with pkgs;
@ -92,7 +93,8 @@ in rec {
in dockerTools.buildLayeredImage { in dockerTools.buildLayeredImage {
name = "nixery"; name = "nixery";
config.Cmd = [ "${nixery-launch-script}/bin/nixery" ]; config.Cmd = [ "${nixery-launch-script}/bin/nixery" ];
maxLayers = 96;
inherit maxLayers;
contents = [ contents = [
bashInteractive bashInteractive
cacert cacert