mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00
Reproduce image incuding its Debian archives date
This commit is contained in:
parent
e1b5a1140a
commit
cbdd7d7fff
1 changed files with 15 additions and 2 deletions
|
@ -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."""
|
"""Build the Dangerzone container image with a special tag."""
|
||||||
platform_args = [] if not platform else ["--platform", platform]
|
platform_args = [] if not platform else ["--platform", platform]
|
||||||
runtime_args = [] if not runtime else ["--runtime", runtime]
|
runtime_args = [] if not runtime else ["--runtime", runtime]
|
||||||
|
date_args = [] if not date else ["--debian-archive-date", date]
|
||||||
run(
|
run(
|
||||||
"python3",
|
"python3",
|
||||||
"./install/common/build-image.py",
|
"./install/common/build-image.py",
|
||||||
"--no-save",
|
"--no-save",
|
||||||
"--use-cache",
|
"--use-cache",
|
||||||
str(use_cache),
|
str(use_cache),
|
||||||
|
*date_args,
|
||||||
*platform_args,
|
*platform_args,
|
||||||
*runtime_args,
|
*runtime_args,
|
||||||
"--tag",
|
"--tag",
|
||||||
|
@ -199,6 +201,11 @@ def parse_args():
|
||||||
action="store_true",
|
action="store_true",
|
||||||
help="Skip checking if the source image tag contains the current Git commit",
|
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()
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
|
@ -221,7 +228,13 @@ def main():
|
||||||
tag = f"reproduce-{commit}"
|
tag = f"reproduce-{commit}"
|
||||||
target = f"{IMAGE_NAME}:{tag}"
|
target = f"{IMAGE_NAME}:{tag}"
|
||||||
logger.info(f"Building container image and tagging it as '{target}'")
|
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(
|
logger.info(
|
||||||
f"Ensuring that source image '{args.source}' is semantically identical with"
|
f"Ensuring that source image '{args.source}' is semantically identical with"
|
||||||
|
|
Loading…
Reference in a new issue