Skip to content

Commit 73c8953

Browse files
committed
chore: To determine the binary format in the Dockerfile, we decided to use TARGETARCH instead of go_arch to facilitate multi-platform build.
Signed-off-by: kahirokunn <[email protected]>
1 parent 5e27da3 commit 73c8953

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# Base image to use at runtime
22
ARG base_image=public.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-nonroot:2021-12-01-1638322424
33

4+
ARG TARGETARCH=amd64
5+
46
# Golang image to use for compiling the manager
57
ARG builder_image=public.ecr.aws/docker/library/golang
68

7-
# Version of Golang
9+
# Version of Golang
810
ARG golang_version
911

1012
# Build the manager binary
@@ -15,14 +17,13 @@ ARG service_alias
1517
ARG service_controller_git_version
1618
ARG service_controller_git_commit
1719
ARG build_date
18-
ARG go_arch=amd64
1920
# The directory within the builder container into which we will copy our
2021
# service controller code.
2122
ARG work_dir=/github.com/aws-controllers-k8s/$service_alias-controller
2223
WORKDIR $work_dir
2324
ENV GOPROXY=https://proxy.golang.org|direct
2425
ENV GO111MODULE=on
25-
ENV GOARCH=$go_arch
26+
ENV GOARCH=$TARGETARCH
2627
ENV GOOS=linux
2728
ENV CGO_ENABLED=0
2829
ENV VERSION_PKG=github.com/aws-controllers-k8s/$service_alias-controller/pkg/version

Dockerfile.local

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ARG base_image=public.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-n
44
# Golang image to use for compiling the manager
55
ARG builder_image=public.ecr.aws/docker/library/golang
66

7-
# Version of Golang
7+
# Version of Golang
88
ARG golang_version
99

1010
# Build the manager binary
@@ -15,14 +15,14 @@ ARG service_alias
1515
ARG service_controller_git_version
1616
ARG service_controller_git_commit
1717
ARG build_date
18-
ARG go_arch=amd64
18+
ARG TARGETARCH=amd64
1919
# The directory within the builder container into which we will copy our
2020
# service controller code.
2121
ARG work_dir=/github.com/aws-controllers-k8s/$service_alias-controller
2222
WORKDIR $work_dir
2323
ENV GOPROXY=https://proxy.golang.org|direct
2424
ENV GO111MODULE=on
25-
ENV GOARCH=$go_arch
25+
ENV GOARCH=$TARGETARCH
2626
ENV GOOS=linux
2727
ENV CGO_ENABLED=0
2828
ENV VERSION_PKG=github.com/aws-controllers-k8s/$service_alias-controller/pkg/version

0 commit comments

Comments
 (0)