Re-declare TARGETPLATFORM ARG in Dockerfiles to ensure availability in build stages and add echo command for better visibility during builds

This commit is contained in:
Luis Eduardo Jeréz Girón
2024-11-02 10:35:48 -06:00
parent 5f60984c50
commit 717abf14c5
3 changed files with 18 additions and 3 deletions
+6 -1
View File
@@ -5,9 +5,14 @@ ARG TARGETPLATFORM
FROM node:20.17.0-bookworm AS node
FROM golang:1.23.1-bookworm AS golang
# Set the base image, general environment variables, and move to temp dir
# Set the base image
FROM debian:12.7
# Re-declare ARG after FROM to make it available in this build stage
ARG TARGETPLATFORM
RUN echo "Building for ${TARGETPLATFORM}"
# Set the general environment variables, and move to temp dir
ENV DEBIAN_FRONTEND="noninteractive"
ENV GOBIN="/usr/local/go-bin"
ENV PATH="$PATH:/usr/local/go-bin:/usr/local/dl-bin:/usr/local/go/bin"
+6 -1
View File
@@ -5,9 +5,14 @@ ARG TARGETPLATFORM
FROM node:20.17.0-bookworm AS node
FROM golang:1.23.1-bookworm AS golang
# Set the base image, general environment variables, and move to temp dir
# Set the base image
FROM debian:12.7
# Re-declare ARG after FROM to make it available in this build stage
ARG TARGETPLATFORM
RUN echo "Building for ${TARGETPLATFORM}"
# Set the general environment variables, and move to temp dir
ENV DEBIAN_FRONTEND="noninteractive"
ENV GOBIN="/usr/local/go-bin"
ENV PATH="$PATH:/usr/local/go-bin:/usr/local/dl-bin:/usr/local/go/bin"
+6 -1
View File
@@ -5,9 +5,14 @@ ARG TARGETPLATFORM
FROM node:20.17.0-bookworm AS node
FROM golang:1.23.1-bookworm AS golang
# Set the base image, general environment variables, and move to temp dir
# Set the base image
FROM debian:12.7
# Re-declare ARG after FROM to make it available in this build stage
ARG TARGETPLATFORM
RUN echo "Building for ${TARGETPLATFORM}"
# Set the general environment variables, and move to temp dir
ENV DEBIAN_FRONTEND="noninteractive"
ENV GOBIN="/usr/local/go-bin"
ENV PATH="$PATH:/usr/local/go-bin:/usr/local/dl-bin:/usr/local/go/bin"