Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add containers.<name>.maxLayers option #872

Merged
merged 2 commits into from
Nov 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/modules/containers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ let
mkDerivation = cfg: nix2container.nix2container.buildImage {
name = cfg.name;
tag = cfg.version;
maxLayers = cfg.maxLayers;
copyToRoot = [
(pkgs.runCommand "create-paths" { } ''
mkdir -p $out/tmp
Expand Down Expand Up @@ -164,6 +165,13 @@ let
docker run -it ${config.name}:${config.version} "$@"
'';
};

maxLayers = lib.mkOption {
type = types.int;
description = "the maximum number of layers to create.";
defaultText = lib.literalExpression "1";
default = 1;
};
};
});
in
Expand Down
Loading