Skip to content

Instantly share code, notes, and snippets.

@richlander
Last active November 4, 2023 07:08
Show Gist options
  • Save richlander/70cde3f0176d36862af80c41722acd47 to your computer and use it in GitHub Desktop.
Save richlander/70cde3f0176d36862af80c41722acd47 to your computer and use it in GitHub Desktop.
Dockerfile built-in ARGs
FROM alpine
ARG TARGETPLATFORM
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT
ARG BUILDPLATFORM
ARG BUILDOS
ARG BUILDARCH
ARG BUILDVARIANT
RUN echo "Building on $BUILDPLATFORM, targeting $TARGETPLATFORM"
RUN echo "Building on ${BUILDOS} and ${BUILDARCH} with optional variant ${BUILDVARIANT}"
RUN echo "Targeting ${TARGETOS} and ${TARGETARCH} with optional variant ${TARGETVARIANT}"
@richlander
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment