From 3a79ca65531adf9fc8799b39407fe4d1b51906f6 Mon Sep 17 00:00:00 2001 From: Doug Rabson Date: Tue, 15 Apr 2025 22:00:50 +0000 Subject: [PATCH] release: avoid sparse-file handling for container image layers This improves compatiblity with Podman. See https://github.com/containers/podman/issues/25270 for details. Differential Revision: https://reviews.freebsd.org/D49821 --- release/scripts/make-oci-image.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/release/scripts/make-oci-image.sh b/release/scripts/make-oci-image.sh index 0fd64602b40..cc599c76bd5 100644 --- a/release/scripts/make-oci-image.sh +++ b/release/scripts/make-oci-image.sh @@ -95,8 +95,13 @@ commit_container() { local image=$1; shift local output=$1; shift - # Note: the diff_id (needed for image config) is the hash of the uncompressed tar - tar -C ${workdir}/rootfs --strip-components 1 -cf ${workdir}/rootfs.tar . + # Note: the diff_id (needed for image config) is the hash of the + # uncompressed tar. + # + # For compatibility with Podman, we must disable sparse-file + # handling. See https://github.com/containers/podman/issues/25270 for + # more details. + tar -C ${workdir}/rootfs --strip-components 1 --no-read-sparse -cf ${workdir}/rootfs.tar . local diff_id=$(sha256 -q < ${workdir}/rootfs.tar) gzip -f ${workdir}/rootfs.tar local create_time=$(date -u +%Y-%m-%dT%TZ)