mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-09-29 15:43:00 +00:00
dockerTools.streamLayeredImage: add includeNixDB argument, expose conf and streamScript
This commit is contained in:
parent
f945939fd6
commit
c055845069
@ -911,6 +911,8 @@ rec {
|
||||
, fakeRootCommands ? ""
|
||||
, enableFakechroot ? false
|
||||
, includeStorePaths ? true
|
||||
# Generate a Nix DB inside the image. The same caveats as `buildImageWithNixDb` apply.
|
||||
, includeNixDB ? false
|
||||
, passthru ? {}
|
||||
,
|
||||
}:
|
||||
@ -941,7 +943,9 @@ rec {
|
||||
customisationLayer = symlinkJoin {
|
||||
name = "${baseName}-customisation-layer";
|
||||
paths = contentsList;
|
||||
inherit extraCommands fakeRootCommands;
|
||||
extraCommands =
|
||||
(lib.optionalString includeNixDB (mkDbExtraCommand contents)) + extraCommands;
|
||||
inherit fakeRootCommands;
|
||||
nativeBuildInputs = [
|
||||
fakeroot
|
||||
] ++ optionals enableFakechroot [
|
||||
@ -1094,7 +1098,9 @@ rec {
|
||||
|
||||
result = runCommand "stream-${baseName}"
|
||||
{
|
||||
inherit conf;
|
||||
inherit (conf) imageName;
|
||||
inherit streamScript;
|
||||
preferLocalBuild = true;
|
||||
passthru = passthru // {
|
||||
inherit (conf) imageTag;
|
||||
@ -1105,7 +1111,7 @@ rec {
|
||||
};
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
} ''
|
||||
makeWrapper ${streamScript} $out --add-flags ${conf}
|
||||
makeWrapper $streamScript $out --add-flags $conf
|
||||
'';
|
||||
in
|
||||
result
|
||||
|
Loading…
Reference in New Issue
Block a user