Skip to content

Commit 6b8d224

Browse files
authored
Recompress slim layers to gzip before pushing (#33)
1 parent 26af47d commit 6b8d224

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/postgresql.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,16 @@ jobs:
240240
regctl image import "ocidir:///tmp/slim-oci:slim" /tmp/slim.tar
241241
rm /tmp/slim.tar
242242
243+
# docker save writes uncompressed layer tarballs (.tar, not .tar.gzip).
244+
# Pushed as-is the slim image lands in the registry larger than the
245+
# un-slimmed base. Recompress layers to gzip in place so the registry
246+
# blob sizes reflect the slim toolkit's actual size win.
247+
regctl image mod "ocidir:///tmp/slim-oci:slim" \
248+
--layer-compress gzip --replace
249+
243250
# Compute the manifest digest locally so we can address the registry push
244-
# by digest URL — no tag is created on Docker Hub.
251+
# by digest URL — no tag is created on Docker Hub. Must happen AFTER the
252+
# mod step: recompressing layers changes layer digests → manifest digest.
245253
DIGEST="$(regctl manifest digest "ocidir:///tmp/slim-oci:slim")"
246254
echo "Slim digest (${{ matrix.arch }}): ${DIGEST}"
247255

0 commit comments

Comments
 (0)