From e39faae5219c93621cbbb59584e66677e07abc2e Mon Sep 17 00:00:00 2001 From: Alexandre Chapellon Date: Tue, 3 Sep 2024 14:43:13 +0200 Subject: [PATCH] leverage env var to target cpu architecture --- Makefile | 8 -------- docker-bake.hcl | 7 ++++++- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index d80b3d2a..d157c5ce 100644 --- a/Makefile +++ b/Makefile @@ -46,14 +46,6 @@ connectors: prepare_connectors @echo "Building Connectors images" @docker buildx bake --no-cache --progress=plain connectors -amd64_all: docker-bake.hcl prepare_all - @echo "Building all images for amd64" - @docker buildx bake --no-cache --progress=plain --set *.platform=linux/amd64 - -arm64_all: docker-bake.hcl prepare_all - @echo "Building all images for arm64" - @docker buildx bake --no-cache --progress=plain --set *.platform=linux/arm64 - all: docker-bake.hcl prepare_all @echo "Building all images" @docker buildx bake --no-cache --progress=plain diff --git a/docker-bake.hcl b/docker-bake.hcl index b5995966..67056f82 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -30,6 +30,10 @@ variable "REGISTRY_NAMESPACE" { default = "alfresco" } +variable "TARGETARCH" { + default = "linux/amd64" +} + variable "TAG" { default = "latest" } @@ -134,7 +138,8 @@ target "java_base" { "org.opencontainers.image.authors" = "${LABEL_AUTHOR}" } tags = ["${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-base-java:${JDIST}${JAVA_MAJOR}-${DISTRIB_NAME}${DISTRIB_MAJOR}"] - output = ["type=cacheonly"] + output = ["type=docker"] + platforms = split(",", "${TARGETARCH}") } variable "TOMCAT_MAJOR" {