diff options
author | rnhmjoj <rnhmjoj@inventati.org> | 2019-01-15 23:41:31 +0100 |
---|---|---|
committer | rnhmjoj <rnhmjoj@inventati.org> | 2019-01-16 20:37:15 +0100 |
commit | bcf54ce5bbc8c325cfd2b6bcc5cec7661ef49183 (patch) | |
tree | 26aef5b71509a26f7986e6cf9928b7687c21787d /pkgs/build-support/docker | |
parent | 3956a8421f2d78bc66ad9d3c23a3b5510bc695be (diff) | |
download | nixpkgs-bcf54ce5bbc8c325cfd2b6bcc5cec7661ef49183.tar nixpkgs-bcf54ce5bbc8c325cfd2b6bcc5cec7661ef49183.tar.gz nixpkgs-bcf54ce5bbc8c325cfd2b6bcc5cec7661ef49183.tar.bz2 nixpkgs-bcf54ce5bbc8c325cfd2b6bcc5cec7661ef49183.tar.lz nixpkgs-bcf54ce5bbc8c325cfd2b6bcc5cec7661ef49183.tar.xz nixpkgs-bcf54ce5bbc8c325cfd2b6bcc5cec7661ef49183.tar.zst nixpkgs-bcf54ce5bbc8c325cfd2b6bcc5cec7661ef49183.zip |
treewide: use ${stdenv.shell} instead of /bin/sh where possible
Diffstat (limited to 'pkgs/build-support/docker')
-rw-r--r-- | pkgs/build-support/docker/default.nix | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/pkgs/build-support/docker/default.nix b/pkgs/build-support/docker/default.nix index b3a4b774b12..6de38821baf 100644 --- a/pkgs/build-support/docker/default.nix +++ b/pkgs/build-support/docker/default.nix @@ -22,7 +22,8 @@ referencesByPopularity, writeScript, writeText, - closureInfo + closureInfo, + substituteAll }: # WARNING: this API is unstable and may be subject to backwards-incompatible changes in the future. @@ -279,6 +280,12 @@ rec { # of room for extension maxLayers ? 24 }: + let + storePathToLayer = substituteAll + { inherit (stdenv) shell; + src = ./store-path-to-layer.sh; + }; + in runCommand "${name}-granular-docker-layers" { inherit maxLayers; paths = referencesByPopularity closure; @@ -298,9 +305,9 @@ rec { # following head and tail call lines, double-check that your # code behaves properly when the number of layers equals: # maxLayers-1, maxLayers, and maxLayers+1 - head -n $((maxLayers - 1)) $paths | cat -n | xargs -P$NIX_BUILD_CORES -n2 ${./store-path-to-layer.sh} + head -n $((maxLayers - 1)) $paths | cat -n | xargs -P$NIX_BUILD_CORES -n2 ${storePathToLayer} if [ $(cat $paths | wc -l) -ge $maxLayers ]; then - tail -n+$maxLayers $paths | xargs ${./store-path-to-layer.sh} $maxLayers + tail -n+$maxLayers $paths | xargs ${storePathToLayer} $maxLayers fi echo "Finished building layer '$name'" |