use rsync, comment out pulls

This commit is contained in:
Allen Nelson 2016-10-03 15:12:29 -05:00
parent b9007c8d83
commit 940aafcbcc
2 changed files with 15 additions and 12 deletions

View File

@ -10,6 +10,7 @@
pkgs, pkgs,
pigz, pigz,
runCommand, runCommand,
rsync,
shadow, shadow,
stdenv, stdenv,
storeDir ? builtins.storeDir, storeDir ? builtins.storeDir,
@ -120,7 +121,7 @@ rec {
}; };
inherit fromImage fromImageName fromImageTag; inherit fromImage fromImageName fromImageTag;
buildInputs = [ utillinux e2fsprogs jshon ]; buildInputs = [ utillinux e2fsprogs jshon rsync ];
} '' } ''
rm -rf $out rm -rf $out
@ -238,7 +239,7 @@ rec {
runCommand "docker-layer-${name}" { runCommand "docker-layer-${name}" {
inherit baseJson contents extraCommands; inherit baseJson contents extraCommands;
buildInputs = [ jshon ]; buildInputs = [ jshon rsync ];
} }
'' ''
mkdir layer mkdir layer
@ -246,9 +247,8 @@ rec {
echo "Adding contents..." echo "Adding contents..."
for item in $contents; do for item in $contents; do
echo "Adding $item" echo "Adding $item"
cp -drf $item/* layer/ rsync -a $item/ layer/
done done
chmod -R ug+w layer/
else else
echo "No contents to add to layer." echo "No contents to add to layer."
fi fi
@ -310,9 +310,8 @@ rec {
echo "Adding contents..." echo "Adding contents..."
for item in ${toString contents}; do for item in ${toString contents}; do
echo "Adding $item..." echo "Adding $item..."
cp -drf $item/* layer/ rsync -a $item/ layer/
done done
chmod -R ug+w layer/
''; '';
postMount = '' postMount = ''

View File

@ -83,12 +83,16 @@ rec {
}; };
# 4. example of pulling an image. could be used as a base for other images # 4. example of pulling an image. could be used as a base for other images
debian = pullImage { #
imageName = "debian"; # ***** Currently broken, getting 404s. Perhaps the docker API has changed?
imageTag = "jessie"; #
# this hash will need change if the tag is updated at docker hub #
sha256 = "18kd495lc2k35h03bpcbdjnix17nlqbwf6nmq3sb161blf0dk14q"; # 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 # 5. example of multiple contents, emacs and vi happily coexisting
editors = buildImage { editors = buildImage {