Skip to content

Instantly share code, notes, and snippets.

@developer-guy
Last active March 31, 2022 12:45
Show Gist options
  • Save developer-guy/25f88d4d07fd1c4800e4e5be4ae379b8 to your computer and use it in GitHub Desktop.
Save developer-guy/25f88d4d07fd1c4800e4e5be4ae379b8 to your computer and use it in GitHub Desktop.
Dockerfile cross-compilation helper tonistiigi/xx
FROM --platform=$BUILDPLATFORM tonistiigi/xx AS xx
FROM base AS build
COPY --from=xx / /
ARG TARGETPLATFORM
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
xx-go build -o /out/example .
..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment