File tree 3 files changed +8
-0
lines changed
3 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ CONTAINER_TOOL_EXTRA_ARGS ?=
17
17
EXTRA_RPM_PACKAGES ?=
18
18
GRAPH_ROOT=$(shell podman info --format '{{ .Store.GraphRoot }}')
19
19
UMASK=$(shell umask)
20
+ IMAGE_VERSION := $(or ${IMAGE_VERSION},$(shell git rev-parse --short HEAD))
20
21
21
22
AUTH_JSON ?=
22
23
Original file line number Diff line number Diff line change @@ -102,6 +102,8 @@ COPY --from=builder --chmod=444 /home/builder/yum-packaging-precompiled-kmod/tmp
102
102
# Temporary workaround until the permanent fix for libdnf is merged
103
103
COPY nvidia-toolkit-firstboot.service /usr/lib/systemd/system/nvidia-toolkit-firstboot.service
104
104
105
+ ARG IMAGE_VERSION
106
+
105
107
# TODO: rework this monstrosity into a build.sh (or even not shell script)
106
108
# The need for the `cp /etc/dnf/dnf.conf` is a workaround for https://github.com/containers/bootc/issues/637
107
109
RUN mv /etc/selinux /etc/selinux.tmp \
@@ -149,6 +151,9 @@ RUN mv /etc/selinux /etc/selinux.tmp \
149
151
# Install rhc connect for insights telemetry gathering
150
152
&& . /etc/os-release && if [ "${ID}" == "rhel" ]; then \
151
153
dnf install -y rhc rhc-worker-playbook; \
154
+ sed -i -e "/^VARIANT=/ {s/^VARIANT=.*/VARIANT=\" RHEL AI\" /; t}" -e "\$ aVARIANT=\" RHEL AI\"\" " /etc/os-release;
155
+ sed -i -e "/^VARIANT_ID=/ {s/^VARIANT_ID=.*/VARIANT_ID=rhel_ai/; t}" -e "\$ aVARIANT_ID=rhel_ai" /etc/os-release;
156
+ sed -i -e "/^BUILD_ID=/ {s/^BUILD_ID=.*/BUILD_ID='${IMAGE_VERSION}'/; t}" -e "\$ aBUILD_ID='${IMAGE_VERSION}'" /etc/os-release;
152
157
fi \
153
158
&& dnf clean all \
154
159
&& ln -s ../cloud-init.target /usr/lib/systemd/system/default.target.wants \
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ bootc: driver-toolkit check-sshkey prepare-files
16
16
$(DRIVER_TOOLKIT_IMAGE:%=--build-arg DRIVER_TOOLKIT_IMAGE=% ) \
17
17
$(DRIVER_VERSION:%=--build-arg DRIVER_VERSION=% ) \
18
18
$(DRIVER_VERSION:%=--label driver-version=% ) \
19
+ $(IMAGE_VERSION:%=--label image_version=% ) \
20
+ $(IMAGE_VERSION:%=--build-arg IMAGE_VERSION=% ) \
19
21
$(EXTRA_RPM_PACKAGES:%=--build-arg EXTRA_RPM_PACKAGES=% ) \
20
22
$(FROM:%=--build-arg BASEIMAGE=% ) \
21
23
$(INSTRUCTLAB_IMAGE:%=--build-arg INSTRUCTLAB_IMAGE=% ) \
You can’t perform that action at this time.
0 commit comments