Skip to content

Commit

Permalink
Support make container on arm64 architecture
Browse files Browse the repository at this point in the history
Signed-off-by: wangzihao <[email protected]>
  • Loading branch information
wangzihao3 committed Dec 26, 2019
1 parent 86c4605 commit 45723af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
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
7 changes: 6 additions & 1 deletion release-tools/build.make
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ 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.
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 +78,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

0 comments on commit 45723af

Please sign in to comment.