Merge pull request #248735 from considerate/considerate/merge-docker

dockerTools: replace --no-clobber with --update=none

authored by Robert Hensing and committed by GitHub 65d41fb5 06a6acb7

+11 -11
+11 -11
pkgs/build-support/docker/default.nix
··· 5 5 , closureInfo 6 6 , coreutils 7 7 , e2fsprogs 8 - , fakechroot 8 + , proot 9 9 , fakeNss 10 10 , fakeroot 11 11 , go ··· 777 777 fi 778 778 done 779 779 # Copy all layers from input images to output image directory 780 - cp -R --no-clobber inputs/*/* image/ 780 + cp -R --update=none inputs/*/* image/ 781 781 # Merge repositories objects and manifests 782 782 jq -s add "''${repos[@]}" > repositories 783 783 jq -s add "''${manifests[@]}" > manifest.json ··· 887 887 }); 888 888 889 889 contentsList = if builtins.isList contents then contents else [ contents ]; 890 + bind-paths = builtins.toString (builtins.map (path: "--bind=${path}:${path}!") [ 891 + "/dev/" 892 + "/proc/" 893 + "/sys/" 894 + "${builtins.storeDir}/" 895 + "$out/layer.tar" 896 + ]); 890 897 891 898 # We store the customisation layer as a tarball, to make sure that 892 899 # things like permissions set on 'extraCommands' are not overridden ··· 898 905 nativeBuildInputs = [ 899 906 fakeroot 900 907 ] ++ optionals enableFakechroot [ 901 - fakechroot 902 - # for chroot 903 - coreutils 904 - # fakechroot needs getopt, which is provided by util-linux 905 - util-linux 908 + proot 906 909 ]; 907 910 postBuild = '' 908 911 mv $out old_out 909 912 (cd old_out; eval "$extraCommands" ) 910 913 911 914 mkdir $out 912 - ${optionalString enableFakechroot '' 913 - export FAKECHROOT_EXCLUDE_PATH=/dev:/proc:/sys:${builtins.storeDir}:$out/layer.tar 914 - ''} 915 - ${optionalString enableFakechroot ''fakechroot chroot $PWD/old_out ''}fakeroot bash -c ' 915 + ${optionalString enableFakechroot ''proot -r $PWD/old_out ${bind-paths} --pwd=/ ''}fakeroot bash -c ' 916 916 source $stdenv/setup 917 917 ${optionalString (!enableFakechroot) ''cd old_out''} 918 918 eval "$fakeRootCommands"