Skip to content

Commit 9dcb6d1

Browse files
committed
Faster multiarch docker builds
* Use GOOS=$TARGETOS GOARCH=$TARGETARCH to cross compile instead of emulating the target architecture.
1 parent a9cc81b commit 9dcb6d1

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
# limitations under the License.
1414
ARG image=public.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-nonroot:2021-12-01-1638322424
1515

16-
FROM golang:1.16 AS builder
16+
FROM --platform=$BUILDPLATFORM golang:1.16 AS builder
1717
WORKDIR /go/src/github.com/kubernetes-sigs/aws-iam-authenticator
1818
COPY . .
19-
RUN make bin
19+
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH make bin
2020
RUN chown 65532 _output/bin/aws-iam-authenticator
2121

2222
FROM public.ecr.aws/eks-distro/kubernetes/go-runner:v0.9.0-eks-1-21-4 as go-runner

cloudbuild.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
images:
2-
- 'gcr.io/$PROJECT_ID/aws-iam-authenticator:$_GIT_TAG'
3-
- 'gcr.io/$PROJECT_ID/aws-iam-authenticator:latest'
41
options:
52
substitution_option: ALLOW_LOOSE
63
steps:

0 commit comments

Comments
 (0)