Skip to content

Commit

Permalink
Fix CONTAINER_INFORMATION handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
barthel committed Sep 24, 2024
1 parent 0e8c7a3 commit f30db7e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,18 @@ LABEL MAINTAINERS="barthel <[email protected]>"
LABEL maintainers="barthel <[email protected]>"
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}"

Expand Down

0 comments on commit f30db7e

Please sign in to comment.