Skip to content

Commit

Permalink
chore(build): Use significantly fewer layers for Nixery itself
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tazjin committed Nov 9, 2019
1 parent 6a37e4a commit b2d3b8f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

{ pkgs ? import <nixpkgs> { }
, preLaunch ? ""
, extraPackages ? [] }:
, extraPackages ? []
, maxLayers ? 20 }:

with pkgs;

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b2d3b8f

Please sign in to comment.