From e73fae7cd4911dd2acc8d81ea66e97c7c2fbd201 Mon Sep 17 00:00:00 2001 From: Dennis Chen Date: Wed, 12 Sep 2018 13:53:19 +0800 Subject: [PATCH] Fix Rook NFS image cross-build issue on AArch64 We need to pull the base image for arm64, not for amd64. This PR add prefix `arm64v8` of `fedora:26` to pull the image for arm64. Signed-off-by: Dennis Chen --- images/nfs/Dockerfile | 2 +- images/nfs/Makefile | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/images/nfs/Dockerfile b/images/nfs/Dockerfile index 89c08616b..87db15788 100644 --- a/images/nfs/Dockerfile +++ b/images/nfs/Dockerfile @@ -14,7 +14,7 @@ #Portions of this file came from https://github.com/kubernetes-incubator/external-storage/blob/master/nfs/deploy/docker/Dockerfile, which uses the same license. -FROM fedora:26 +FROM NFS_BASEIMAGE # Build ganesha from source, installing deps and removing them in one line. # Why? diff --git a/images/nfs/Makefile b/images/nfs/Makefile index 001857c37..2f383117e 100755 --- a/images/nfs/Makefile +++ b/images/nfs/Makefile @@ -19,6 +19,14 @@ include ../image.mk NFS_IMAGE = $(BUILD_REGISTRY)/nfs-$(GOARCH) +NFS_BASE ?= fedora:26 + +ifeq ($(GOARCH),amd64) +NFS_BASEIMAGE = $(NFS_BASE) +else ifeq ($(GOARCH),arm64) +NFS_BASEIMAGE = arm64v8/$(NFS_BASE) +endif + TEMP := $(shell mktemp -d) # ==================================================================================== @@ -35,6 +43,7 @@ do.build: @cp Dockerfile $(TEMP) @cp start.sh $(TEMP) @cp $(OUTPUT_DIR)/bin/linux_$(GOARCH)/rook $(TEMP) + @cd $(TEMP) && $(SED_CMD) 's|NFS_BASEIMAGE|$(NFS_BASEIMAGE)|g' Dockerfile @docker build $(BUILD_ARGS) \ -t $(NFS_IMAGE) \ $(TEMP)