diff --git a/pkgs/build-support/docker/default.nix b/pkgs/build-support/docker/default.nix index 578025c11138..b3db68a665dc 100644 --- a/pkgs/build-support/docker/default.nix +++ b/pkgs/build-support/docker/default.nix @@ -10,6 +10,7 @@ pkgs, pigz, runCommand, + rsync, shadow, stdenv, storeDir ? builtins.storeDir, @@ -120,7 +121,7 @@ rec { }; inherit fromImage fromImageName fromImageTag; - buildInputs = [ utillinux e2fsprogs jshon ]; + buildInputs = [ utillinux e2fsprogs jshon rsync ]; } '' rm -rf $out @@ -238,7 +239,7 @@ rec { runCommand "docker-layer-${name}" { inherit baseJson contents extraCommands; - buildInputs = [ jshon ]; + buildInputs = [ jshon rsync ]; } '' mkdir layer @@ -246,9 +247,8 @@ rec { echo "Adding contents..." for item in $contents; do echo "Adding $item" - cp -drf $item/* layer/ + rsync -a $item/ layer/ done - chmod -R ug+w layer/ else echo "No contents to add to layer." fi @@ -310,9 +310,8 @@ rec { echo "Adding contents..." for item in ${toString contents}; do echo "Adding $item..." - cp -drf $item/* layer/ + rsync -a $item/ layer/ done - chmod -R ug+w layer/ ''; postMount = '' diff --git a/pkgs/build-support/docker/examples.nix b/pkgs/build-support/docker/examples.nix index cce8f53834e4..05b4a9b4f2d2 100644 --- a/pkgs/build-support/docker/examples.nix +++ b/pkgs/build-support/docker/examples.nix @@ -83,12 +83,16 @@ rec { }; # 4. example of pulling an image. could be used as a base for other images - debian = pullImage { - imageName = "debian"; - imageTag = "jessie"; - # this hash will need change if the tag is updated at docker hub - sha256 = "18kd495lc2k35h03bpcbdjnix17nlqbwf6nmq3sb161blf0dk14q"; - }; + # + # ***** Currently broken, getting 404s. Perhaps the docker API has changed? + # + # + # debian = pullImage { + # imageName = "debian"; + # imageTag = "jessie"; + # # this hash will need change if the tag is updated at docker hub + # sha256 = "18kd495lc2k35h03bpcbdjnix17nlqbwf6nmq3sb161blf0dk14q"; + # }; # 5. example of multiple contents, emacs and vi happily coexisting editors = buildImage {