From f30db7e144ac563627e6dac5ff90b2b1710af69c Mon Sep 17 00:00:00 2001 From: barthel Date: Tue, 24 Sep 2024 15:48:28 +0200 Subject: [PATCH] Fix CONTAINER_INFORMATION handling. --- Dockerfile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index aad000c..01583ac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,7 +27,18 @@ LABEL MAINTAINERS="barthel " LABEL maintainers="barthel " LABEL CONTAINER_INFORMATION="${CONTAINER_INFORMATION}" -ENV CONTAINER_INFORMATION="${CONTAINER_INFORMATION} - (${TARGETARCH})" +# Set ENV variable to the value of the ARG parameter and add TARGETARCH +# This ensures that the ARG value is used and not an ENV that may have been overwritten by the base container. +RUN export CONTAINER_INFORMATION="${CONTAINER_INFORMATION} - (${TARGETARCH})" && \ + echo $CONTAINER_INFORMATION > /tmp/container_info && \ + echo "CONTAINER_INFORMATION=${CONTAINER_INFORMATION}" > /tmp/envs + +# Load the ENV variable from the temporary file to make it available in the container +ENV CONTAINER_INFORMATION="$(cat /tmp/container_info)" + +# Optional: Entferne die temporäre Datei, wenn nicht mehr benötigt +RUN rm /tmp/container_info /tmp/envs + # Print the architecture RUN echo "Building for architecture: ${TARGETARCH}"