Files
kubernetes-sigs_nfs-subdir-…/Dockerfile.multiarch
T
retornam bca82e364d fix: upgrade tonistiigi/xx to 1.6.1
The version of xx is out-of-date.
Upgrading to version 1.6.1 to keep up
with changes to the xx project.

Signed-off-by: Raymond Etornam <retornam@users.noreply.github.com>
2025-06-05 20:03:17 -07:00

22 lines
635 B
Docker

FROM --platform=$BUILDPLATFORM golang:1.19 as build-env
# xx wraps go to automatically configure $GOOS, $GOARCH, and $GOARM
# based on TARGETPLATFORM provided by Docker.
COPY --from=tonistiigi/xx:1.6.1 / /
ARG APP_FOLDER
ADD . ${APP_FOLDER}
WORKDIR ${APP_FOLDER}
# Compile independent executable using go wrapper from xx:golang
ARG TARGETPLATFORM
RUN CGO_ENABLED=0 xx-go build -a -ldflags '-extldflags "-static"' -o /bin/main ./cmd/nfs-subdir-external-provisioner
FROM --platform=$TARGETPLATFORM alpine:3.18
RUN apk update --no-cache && apk add ca-certificates
COPY --from=build-env /bin/main /app/main
ENTRYPOINT ["/app/main"]