dockerTools: add streamed image as passthru to buildLayeredImage

This is convenient for debugging the underlying streamed image used by
`dockerTools.buildLayeredImage`.

Here's an example of how you might use this:

```console
$ nix repl ./.
nix-repl> dockerTools.examples.nginx.passthru.stream
«derivation /nix/store/9zczmlp2kraszx4ssmh6fawnlnsa5a4n-stream-nginx-container.drv»
```
This commit is contained in:
Dennis Gosnell 2024-03-23 10:33:22 +09:00
parent 1197d0d7e6
commit 2e91dc65e4

View file

@ -523,7 +523,7 @@ rec {
runCommand "${baseNameOf name}.tar${compress.ext}" runCommand "${baseNameOf name}.tar${compress.ext}"
{ {
inherit (stream) imageName; inherit (stream) imageName;
passthru = { inherit (stream) imageTag; }; passthru = { inherit (stream) imageTag; inherit stream; };
nativeBuildInputs = compress.nativeInputs; nativeBuildInputs = compress.nativeInputs;
} "${stream} | ${compress.compress} > $out" } "${stream} | ${compress.compress} > $out"
); );