forked from mirrors/nixpkgs
dockerTools: make gzipped docker images faster to update by rsync
This passes --rsyncable / -R to pigz for input-determined block locations, to improve rsync-ability.
This commit is contained in:
parent
bc55008de1
commit
d2b0f9a9f6
|
@ -486,7 +486,7 @@ rec {
|
||||||
inherit (stream) imageName;
|
inherit (stream) imageName;
|
||||||
passthru = { inherit (stream) imageTag; };
|
passthru = { inherit (stream) imageTag; };
|
||||||
nativeBuildInputs = [ pigz ];
|
nativeBuildInputs = [ pigz ];
|
||||||
} "${stream} | pigz -nT > $out";
|
} "${stream} | pigz -nTR > $out";
|
||||||
|
|
||||||
# 1. extract the base image
|
# 1. extract the base image
|
||||||
# 2. create the layer
|
# 2. create the layer
|
||||||
|
@ -735,7 +735,7 @@ rec {
|
||||||
chmod -R a-w image
|
chmod -R a-w image
|
||||||
|
|
||||||
echo "Cooking the image..."
|
echo "Cooking the image..."
|
||||||
tar -C image --hard-dereference --sort=name --mtime="@$SOURCE_DATE_EPOCH" --owner=0 --group=0 --xform s:'^./':: -c . | pigz -nT > $out
|
tar -C image --hard-dereference --sort=name --mtime="@$SOURCE_DATE_EPOCH" --owner=0 --group=0 --xform s:'^./':: -c . | pigz -nTR > $out
|
||||||
|
|
||||||
echo "Finished."
|
echo "Finished."
|
||||||
'';
|
'';
|
||||||
|
@ -775,7 +775,7 @@ rec {
|
||||||
mv repositories image/repositories
|
mv repositories image/repositories
|
||||||
mv manifest.json image/manifest.json
|
mv manifest.json image/manifest.json
|
||||||
# Create tarball and gzip
|
# Create tarball and gzip
|
||||||
tar -C image --hard-dereference --sort=name --mtime="@$SOURCE_DATE_EPOCH" --owner=0 --group=0 --xform s:'^./':: -c . | pigz -nT > $out
|
tar -C image --hard-dereference --sort=name --mtime="@$SOURCE_DATE_EPOCH" --owner=0 --group=0 --xform s:'^./':: -c . | pigz -nTR > $out
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
||||||
|
@ -1220,5 +1220,5 @@ rec {
|
||||||
inherit (stream) imageName;
|
inherit (stream) imageName;
|
||||||
passthru = { inherit (stream) imageTag; };
|
passthru = { inherit (stream) imageTag; };
|
||||||
nativeBuildInputs = [ pigz ];
|
nativeBuildInputs = [ pigz ];
|
||||||
} "${stream} | pigz -nT > $out";
|
} "${stream} | pigz -nTR > $out";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue