Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support make container on arm64 architecture #389

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM gcr.io/distroless/static:latest
ARG BASE_IMAGE=gcr.io/distroless/static:latest
FROM $BASE_IMAGE
LABEL maintainers="Kubernetes Authors"
LABEL description="CSI External Provisioner"

Expand Down
8 changes: 7 additions & 1 deletion release-tools/build.make
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ endif

ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH))

# Specific BASE_IMAGE for different arch, default BASE_IMAGE gcr.io/distroless is for x86, discolix/static is for arm.
BASE_IMAGE=gcr.io/distroless/static:latest
ifeq (${ARCH}, arm64)
BASE_IMAGE=discolix/static:latest
endif

# Specific packages can be excluded from each of the tests below by setting the *_FILTER_CMD variables
# to something like "| grep -v 'github.com/kubernetes-csi/project/pkg/foobar'". See usage below.

Expand All @@ -73,7 +79,7 @@ build-%: check-go-version-go
fi

container-%: build-%
docker build -t $*:latest -f $(shell if [ -e ./cmd/$*/Dockerfile ]; then echo ./cmd/$*/Dockerfile; else echo Dockerfile; fi) --label revision=$(REV) .
docker build -t $*:latest -f $(shell if [ -e ./cmd/$*/Dockerfile ]; then echo ./cmd/$*/Dockerfile; else echo Dockerfile; fi) --label revision=$(REV) --build-arg BASE_IMAGE=${BASE_IMAGE} .

push-%: container-%
set -ex; \
Expand Down