Skip to content

Commit

Permalink
Enable cross-compilation in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernest Wong committed May 17, 2023
1 parent 0a6a87e commit 3196ba5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Expand Up @@ -18,12 +18,13 @@ FROM --platform=$BUILDPLATFORM $golang_image AS builder
WORKDIR /go/src/github.com/kubernetes-sigs/aws-iam-authenticator
COPY . .
RUN go mod download
ARG TARGETOS TARGETARCH
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH make bin
RUN chown 65532 _output/bin/aws-iam-authenticator

FROM public.ecr.aws/eks-distro/kubernetes/go-runner:v0.9.0-eks-1-21-4 as go-runner
FROM --platform=$TARGETPLATFORM public.ecr.aws/eks-distro/kubernetes/go-runner:v0.9.0-eks-1-21-4 as go-runner

FROM $image
FROM --platform=$TARGETPLATFORM $image
COPY --from=go-runner /usr/local/bin/go-runner /usr/local/bin/go-runner
COPY --from=builder /go/src/github.com/kubernetes-sigs/aws-iam-authenticator/_output/bin/aws-iam-authenticator /aws-iam-authenticator
ENTRYPOINT ["/aws-iam-authenticator"]

0 comments on commit 3196ba5

Please sign in to comment.