Skip to content

Commit 9ea58cc

Browse files
committed
build: Add image version label to test container image
Set org.opencontainers.image.version in the Dockerfile so that bootc status shows a Version line for the booted deployment. The version is derived from git by the Justfile and defaults to "devel" for standalone builds. Assisted-by: OpenCode (Claude claude-opus-4-6) Signed-off-by: Colin Walters <walters@verbum.org>
1 parent 05a798d commit 9ea58cc

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ LABEL bootc.testimage="1"
6767
# Otherwise standard metadata
6868
LABEL containers.bootc 1
6969
LABEL ostree.bootable 1
70+
# Version from git, passed via Justfile; ensures `bootc status` shows a version
71+
ARG image_version="devel"
72+
LABEL org.opencontainers.image.version="${image_version}"
7073
# https://pagure.io/fedora-kiwi-descriptions/pull-request/52
7174
ENV container=oci
7275
# Optional labels that only apply when running this image as a container. These keep the default entry point running under systemd.

Justfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ build: package _keygen && _pull-lbi-images
6969
set -xeuo pipefail
7070
test -d target/packages
7171
pkg_path=$(realpath target/packages)
72-
podman build {{_nocache_arg}} --build-context "packages=${pkg_path}" -t {{base_img}} {{buildargs}} .
72+
eval $(just _git-build-vars)
73+
podman build {{_nocache_arg}} --build-arg=image_version=${VERSION} --build-context "packages=${pkg_path}" -t {{base_img}} {{buildargs}} .
7374

7475
# Show available build variants and current configuration
7576
[group('core')]

0 commit comments

Comments
 (0)