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;
|
||||
passthru = { inherit (stream) imageTag; };
|
||||
nativeBuildInputs = [ pigz ];
|
||||
} "${stream} | pigz -nT > $out";
|
||||
} "${stream} | pigz -nTR > $out";
|
||||
|
||||
# 1. extract the base image
|
||||
# 2. create the layer
|
||||
|
@ -735,7 +735,7 @@ rec {
|
|||
chmod -R a-w 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."
|
||||
'';
|
||||
|
@ -775,7 +775,7 @@ rec {
|
|||
mv repositories image/repositories
|
||||
mv manifest.json image/manifest.json
|
||||
# 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;
|
||||
passthru = { inherit (stream) imageTag; };
|
||||
nativeBuildInputs = [ pigz ];
|
||||
} "${stream} | pigz -nT > $out";
|
||||
} "${stream} | pigz -nTR > $out";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue