From 4b543dde7e843ce1455a8d5334a24446947cc795 Mon Sep 17 00:00:00 2001 From: Alex O'Regan Date: Wed, 30 Sep 2026 14:58:42 +0100 Subject: [PATCH 1/2] Pull the base images on every build Without --pull, a build reuses any local copy of a floating base tag, so the image can be built on a base older than the registry's. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Alex O'Regan --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 858ebda..713fb46 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ PROMETHEUS_DUMP_PATH ?= $(shell find ./must-gather.local* -name prom_data.tar.gz build: docker-build docker-push docker-build: - ${CONTAINER_ENGINE} build --build-arg BUILD_DATE=${BUILD_DATE} -f build/Dockerfile -t ${IMAGE_REGISTRY}/${IMAGE_NAME}:${IMAGE_TAG} . + ${CONTAINER_ENGINE} build --pull --build-arg BUILD_DATE=${BUILD_DATE} -f build/Dockerfile -t ${IMAGE_REGISTRY}/${IMAGE_NAME}:${IMAGE_TAG} . docker-push: ${CONTAINER_ENGINE} push ${IMAGE_REGISTRY}/${IMAGE_NAME}:${IMAGE_TAG} From 8cc0721db19263d26c350578f0bef38f4136c6b4 Mon Sep 17 00:00:00 2001 From: Alex O'Regan Date: Wed, 30 Sep 2026 14:58:42 +0100 Subject: [PATCH 2/2] Reference BUILD_DATE in the package update Docker re-runs a RUN when an ARG declared ahead of it changes, but other builders need the value used in the instruction itself. Referencing it makes the update re-run on every build whichever builder is used. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Alex O'Regan --- build/Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build/Dockerfile b/build/Dockerfile index 194c785..4027ed9 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -2,10 +2,11 @@ FROM quay.io/openshift/origin-must-gather:4.22 as builder FROM registry.access.redhat.com/ubi9-minimal:latest -# BUILD_DATE differs on every build, so declaring it here re-runs the package -# update rather than reusing a cached layer from an earlier build. +# BUILD_DATE differs on every build. The update below references it, so it +# re-runs rather than reusing a cached layer from an earlier build. ARG BUILD_DATE=unknown -RUN microdnf -y update && \ +RUN echo "Updating packages for build ${BUILD_DATE}" && \ + microdnf -y update && \ microdnf -y install rsync tar gzip jq findutils && \ microdnf -y clean all