Skip to content

Commit

Permalink
Add Debian archive date when building image
Browse files Browse the repository at this point in the history
  • Loading branch information
apyrgio committed Feb 6, 2025
1 parent 0455986 commit e1b5a11
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions install/common/build-image.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ def main():
default=None,
help="Provide a custom tag for the image (for development only)",
)
parser.add_argument(
"--debian-archive-date",
default=None,
help="Use a specific Debian snapshot archive, by its date",
)
args = parser.parse_args()

tarball_path = Path("share") / "container.tar.gz"
Expand All @@ -97,6 +102,12 @@ def main():

tag = args.tag or determine_git_tag()
image_name_tagged = IMAGE_NAME + ":" + tag
build_args = []

if args.debian_archive_date:
print(f"Using Debian archive snapshot date '{args.debian_archive_date}'")
build_args = ["--build-arg", f"DEBIAN_ARCHIVE_DATE={args.debian_archive_date}"]
image_name_tagged = "f{args.debian_archive_date}-{image_name_tagged}"

print(f"Will tag the container image as '{image_name_tagged}'")
with open(image_id_path, "w") as f:
Expand All @@ -111,6 +122,7 @@ def main():
args.runtime,
"build",
BUILD_CONTEXT,
*build_args,
*cache_args,
*platform_args,
"-f",
Expand Down

0 comments on commit e1b5a11

Please sign in to comment.