From cbdd7d7fffa2680e822013add9c134dc34295dfe Mon Sep 17 00:00:00 2001 From: Alex Pyrgiotis Date: Thu, 6 Feb 2025 14:25:29 +0200 Subject: [PATCH] Reproduce image incuding its Debian archives date --- dev_scripts/reproduce-image.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/dev_scripts/reproduce-image.py b/dev_scripts/reproduce-image.py index 1f0220d11..49152b0d3 100755 --- a/dev_scripts/reproduce-image.py +++ b/dev_scripts/reproduce-image.py @@ -140,16 +140,18 @@ def diffoci_diff(runtime, source, local_target, platform=None): ) -def build_image(tag, use_cache=False, platform=None, runtime=None): +def build_image(tag, use_cache=False, platform=None, runtime=None, date=None): """Build the Dangerzone container image with a special tag.""" platform_args = [] if not platform else ["--platform", platform] runtime_args = [] if not runtime else ["--runtime", runtime] + date_args = [] if not date else ["--debian-archive-date", date] run( "python3", "./install/common/build-image.py", "--no-save", "--use-cache", str(use_cache), + *date_args, *platform_args, *runtime_args, "--tag", @@ -199,6 +201,11 @@ def parse_args(): action="store_true", help="Skip checking if the source image tag contains the current Git commit", ) + parser.add_argument( + "--debian-archive-date", + default=None, + help="Use a specific Debian snapshot archive, by its date", + ) return parser.parse_args() @@ -221,7 +228,13 @@ def main(): tag = f"reproduce-{commit}" target = f"{IMAGE_NAME}:{tag}" logger.info(f"Building container image and tagging it as '{target}'") - build_image(tag, args.use_cache, args.platform, args.runtime) + build_image( + tag, + args.use_cache, + args.platform, + args.runtime, + args.debian_archive_date, + ) logger.info( f"Ensuring that source image '{args.source}' is semantically identical with"