diff options
author | Robert Scott <code@humanleg.org.uk> | 2023-01-01 23:43:00 +0000 |
---|---|---|
committer | Robert Scott <code@humanleg.org.uk> | 2023-09-11 21:10:37 +0100 |
commit | 38c1400f67f6af73821d5be82f0ddab548e707e2 (patch) | |
tree | 39ef63bf676c9ce5f753c5ea00164ea92eecbbc2 /pkgs/build-support/docker/default.nix | |
parent | 63b12f0e0e71cbdf803147c90e6ff6afea97e4b6 (diff) | |
download | nixpkgs-38c1400f67f6af73821d5be82f0ddab548e707e2.tar nixpkgs-38c1400f67f6af73821d5be82f0ddab548e707e2.tar.gz nixpkgs-38c1400f67f6af73821d5be82f0ddab548e707e2.tar.bz2 nixpkgs-38c1400f67f6af73821d5be82f0ddab548e707e2.tar.lz nixpkgs-38c1400f67f6af73821d5be82f0ddab548e707e2.tar.xz nixpkgs-38c1400f67f6af73821d5be82f0ddab548e707e2.tar.zst nixpkgs-38c1400f67f6af73821d5be82f0ddab548e707e2.zip |
dockerTools: use makeOverridable for buildImage family of functions
this allows nix users to modify existing images without having to rely on container image inheritance mechanisms via fromImage
Diffstat (limited to 'pkgs/build-support/docker/default.nix')
-rw-r--r-- | pkgs/build-support/docker/default.nix | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/pkgs/build-support/docker/default.nix b/pkgs/build-support/docker/default.nix index 9f57804e957..1ac0a69f745 100644 --- a/pkgs/build-support/docker/default.nix +++ b/pkgs/build-support/docker/default.nix @@ -487,7 +487,7 @@ rec { ''; }; - buildLayeredImage = { name, ... }@args: + buildLayeredImage = lib.makeOverridable ({ name, ... }@args: let stream = streamLayeredImage args; in @@ -496,7 +496,8 @@ rec { inherit (stream) imageName; passthru = { inherit (stream) imageTag; }; nativeBuildInputs = [ pigz ]; - } "${stream} | pigz -nTR > $out"; + } "${stream} | pigz -nTR > $out" + ); # 1. extract the base image # 2. create the layer @@ -504,7 +505,7 @@ rec { # 4. compute the layer id # 5. put the layer in the image # 6. repack the image - buildImage = + buildImage = lib.makeOverridable ( args@{ # Image name. name @@ -751,7 +752,8 @@ rec { ''; in - checked result; + checked result + ); # Merge the tarballs of images built with buildImage into a single # tarball that contains all images. Running `docker load` on the resulting @@ -837,7 +839,7 @@ rec { }) ); - streamLayeredImage = + streamLayeredImage = lib.makeOverridable ( { # Image Name name @@ -1046,7 +1048,8 @@ rec { makeWrapper ${streamScript} $out --add-flags ${conf} ''; in - result; + result + ); # This function streams a docker image that behaves like a nix-shell for a derivation streamNixShellImage = |