|
8 | 8 | SA?=source activate |
9 | 9 | ENV:=enterprise-gateway-dev |
10 | 10 | SHELL:=/bin/bash |
| 11 | +SUPPORTED_ARCHS=linux/arm64 linux/amd64 |
| 12 | +PLATFORM_ARCHS=`echo ${SUPPORTED_ARCHS} | sed "s/ /,/g"` |
11 | 13 |
|
12 | 14 | # Docker attributes - hub organization and tag. Modify accordingly |
13 | 15 | HUB_ORG:=elyra |
@@ -43,7 +45,7 @@ TOREE_LAUNCHER_FILES:=$(shell find kernel-launchers/scala/toree-launcher/src -ty |
43 | 45 | ../build/kernelspecs: kernel-launchers/scala/lib $(FILES_kernelspecs_all) |
44 | 46 | @rm -rf ../build/kernelspecs |
45 | 47 | @mkdir -p ../build/kernelspecs |
46 | | - # Seed the build tree with initial files |
| 48 | + # Seed the build tree with initial files |
47 | 49 | cp -r kernelspecs ../build |
48 | 50 | # Distribute language and config-sensitive files. |
49 | 51 | # On-prem kernelspecs get launcher files in the kernelspec hierarchy |
@@ -153,10 +155,15 @@ ifdef MULTIARCH_BUILD |
153 | 155 | @echo "starting buildx builder for $1" |
154 | 156 | -@(docker buildx rm $1) |
155 | 157 | (docker buildx create --use --name $1) |
156 | | - (cd ../build/docker/$1; docker buildx build ${NO_CACHE} --platform linux/arm64,linux/amd64 --build-arg HUB_ORG=${HUB_ORG} --build-arg TAG=${TAG} --build-arg SPARK_VERSION=${SPARK_VERSION} -t $(HUB_ORG)/$1:$(TAG) . --push) |
| 158 | + (cd ../build/docker/$1; docker buildx build ${NO_CACHE} --platform $(PLATFORM_ARCHS) --build-arg HUB_ORG=${HUB_ORG} --build-arg TAG=${TAG} --build-arg SPARK_VERSION=${SPARK_VERSION} -t $(HUB_ORG)/$1:$(TAG) . --push) |
157 | 159 | @echo "remove builder instance $1" |
158 | 160 | -(docker buildx rm $1) |
| 161 | +else ifeq ($(TARGET_ARCH), $(filter $(TARGET_ARCH), $(SUPPORTED_ARCHS))) |
| 162 | + @echo "Building docker image for $(TARGET_ARCH)" |
| 163 | + (cd ../build/docker/$1; docker build ${NO_CACHE} --platform ${TARGET_ARCH} --build-arg HUB_ORG=${HUB_ORG} --build-arg TAG=${TAG} --build-arg SPARK_VERSION=${SPARK_VERSION} -t $(HUB_ORG)/$1:$(TAG) .) |
| 164 | + @-docker images $(HUB_ORG)/$1:$(TAG) |
159 | 165 | else |
| 166 | + @echo "TARGET_ARCH not defined or not in supported platforms: $(PLATFORM_ARCHS). Building docker image for default platform" |
160 | 167 | (cd ../build/docker/$1; docker build ${NO_CACHE} --build-arg HUB_ORG=${HUB_ORG} --build-arg TAG=${TAG} --build-arg SPARK_VERSION=${SPARK_VERSION} -t $(HUB_ORG)/$1:$(TAG) .) |
161 | 168 | @-docker images $(HUB_ORG)/$1:$(TAG) |
162 | 169 | endif |
|
0 commit comments