File tree 2 files changed +12
-4
lines changed
2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -235,7 +235,7 @@ docker::configure() {
235
235
docker::import () (
236
236
local -r uri=" $1 "
237
237
local filename=" $2 " arch=" $3 "
238
- local layers=() config= image= registry= tag= user= tmpdir=
238
+ local layers=() config= image= registry= tag= user= tmpdir= timestamp=()
239
239
240
240
common::checkcmd curl grep awk jq parallel tar " ${ENROOT_GZIP_PROGRAM} " find mksquashfs zstd
241
241
@@ -308,11 +308,15 @@ docker::import() (
308
308
zstd -q -d -o config " ${ENROOT_CACHE_PATH} /${config} "
309
309
docker::configure " ${PWD} /0" config " ${arch} "
310
310
311
+ if [ -n " ${SOURCE_DATE_EPOCH-} " ]; then
312
+ timestamp=(" -mkfs-time" " ${SOURCE_DATE_EPOCH} " " -all-time" " ${SOURCE_DATE_EPOCH} " )
313
+ fi
314
+
311
315
# Create the final squashfs filesystem by overlaying all the layers.
312
316
common::log INFO " Creating squashfs filesystem..." NL
313
317
mkdir rootfs
314
318
MOUNTPOINT=" ${PWD} /rootfs" \
315
- enroot-mksquashovlfs " 0:$( seq -s: 1 " ${# layers[@]} " ) " " ${filename} " -all-root ${TTY_OFF+-no-progress} -processors " ${ENROOT_MAX_PROCESSORS} " ${ENROOT_SQUASH_OPTIONS} >&2
319
+ enroot-mksquashovlfs " 0:$( seq -s: 1 " ${# layers[@]} " ) " " ${filename} " ${timestamp[@]+ " ${timestamp[@]} " } -all-root ${TTY_OFF+-no-progress} -processors " ${ENROOT_MAX_PROCESSORS} " ${ENROOT_SQUASH_OPTIONS} >&2
316
320
)
317
321
318
322
docker::daemon::import () (
Original file line number Diff line number Diff line change @@ -559,7 +559,7 @@ runtime::remove() {
559
559
560
560
runtime::bundle () (
561
561
local image=" $1 " filename=" $2 " target=" $3 " desc=" $4 "
562
- local super= tmpdir= compress=
562
+ local super= tmpdir= compress= timestamp=
563
563
564
564
common::checkcmd unsquashfs find awk grep
565
565
@@ -625,8 +625,12 @@ runtime::bundle() (
625
625
[ -d " ${environ_dirs[1]} " ] && cp -Lpr " ${environ_dirs[1]} " " ${tmpdir}${bundle_usrconf_dir} "
626
626
fi
627
627
628
+ if [ -n " ${SOURCE_DATE_EPOCH-} " ]; then
629
+ timestamp=" --mtime=@${SOURCE_DATE_EPOCH} "
630
+ fi
631
+
628
632
# Make a self-extracting archive with the entrypoint being our bundle script.
629
- enroot-makeself --tar-quietly --tar-extra ' --numeric-owner --owner=0 --group=0 --ignore-failed-read' \
633
+ enroot-makeself --tar-quietly --tar-extra " --numeric-owner --owner=0 --group=0 --ignore-failed-read ${timestamp} " \
630
634
--nomd5 --nocrc ${ENROOT_BUNDLE_CHECKSUM: +--sha256} --header " ${ENROOT_LIBRARY_PATH} /bundle.sh" " ${compress} " \
631
635
--target " ${target} " " ${tmpdir} " " ${filename} " " ${desc} " -- \
632
636
" ${bundle_bin_dir} " " ${bundle_lib_dir} " " ${bundle_envconf} " " ${bundle_sysconf_dir} " " ${bundle_usrconf_dir} " >&2
You can’t perform that action at this time.
0 commit comments