diff --git a/README.md b/README.md index 22b94d4d..3c5fae92 100644 --- a/README.md +++ b/README.md @@ -37,3 +37,17 @@ types of files in the right locations: * Alfresco Module Packages (AMPs) files in the [amps}(repository/amps/README.md) folder * Additional JAR files for the JRE in the [libs](repository/libs/README.md) folder + +## Architecture choice + +The image architecture defaults to the building system's architecture. To modify +it, you need to adjust the `TARGET_ARCH` variable in the Bake file to a specific +architecture, such as `linux/amd64`. + +``` + +variable "TARGET_ARCH" { + default = "linux/amd64" +} + +``` diff --git a/docker-bake.hcl b/docker-bake.hcl index b5995966..98138f3b 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -102,6 +102,10 @@ variable "ALFRESCO_REPO_USER_NAME" { default = "alfresco" } +variable "TARGET_ARCH" { + default = "" # linux/amd64 linux/arm64 +} + target "java_base" { context = "./java" dockerfile = "Dockerfile" @@ -135,6 +139,7 @@ target "java_base" { } tags = ["${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-base-java:${JDIST}${JAVA_MAJOR}-${DISTRIB_NAME}${DISTRIB_MAJOR}"] output = ["type=cacheonly"] + platforms = TARGET_ARCH != "" ? ["${TARGET_ARCH}"] : [] } variable "TOMCAT_MAJOR" { @@ -178,6 +183,7 @@ target "tomcat_base" { } tags = ["${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-base-tomcat:tomcat${TOMCAT_MAJOR}-${JDIST}${JAVA_MAJOR}-${DISTRIB_NAME}${DISTRIB_MAJOR}"] output = ["type=cacheonly"] + platforms = TARGET_ARCH != "" ? ["${TARGET_ARCH}"] : [] } target "repository" {