Merge pull request #207403 from wfranzini/docker-rsyncable-images

dockerTools: make gzipped docker images faster to update by rsync
This commit is contained in:
Robert Hensing 2022-12-23 15:49:04 +01:00 committed by GitHub
commit 1779a185aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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";
}