Merge pull request #187 from hercules-ci/image-fakeRootCommands

Add `image.fakeRootCommands`
This commit is contained in:
Robert Hensing 2023-02-22 10:34:00 +01:00 committed by GitHub
commit e67a5d3049
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,6 +30,7 @@ let
{ {
name = null; tag = null; contents = null; config = null; name = null; tag = null; contents = null; config = null;
created = null; extraCommands = null; maxLayers = null; created = null; extraCommands = null; maxLayers = null;
fakeRootCommands = null;
} }
args; args;
acceptedArgs = functionArgs dockerTools.streamLayeredImage; acceptedArgs = functionArgs dockerTools.streamLayeredImage;
@ -67,6 +68,8 @@ let
ln -s $i nix/var/nix/gcroots/docker/$(basename $i) ln -s $i nix/var/nix/gcroots/docker/$(basename $i)
done; done;
''; '';
fakeRootCommands = config.image.fakeRootCommands;
}; };
priorityIsDefault = option: option.highestPrio >= (lib.mkDefault true).priority; priorityIsDefault = option: option.highestPrio >= (lib.mkDefault true).priority;
@ -120,6 +123,15 @@ in
Top level paths in the container. Top level paths in the container.
''; '';
}; };
image.fakeRootCommands = mkOption {
type = types.lines;
default = "";
description = ''
Commands that build the root of the container in the current working directory.
See [`dockerTools.buildLayeredImage`](https://nixos.org/manual/nixpkgs/stable/#ssec-pkgs-dockerTools-buildLayeredImage).
'';
};
image.includeStorePaths = mkOption { image.includeStorePaths = mkOption {
type = bool; type = bool;
default = true; default = true;