Skip to content

Commit

Permalink
OPSEXP-2797 Add TARGET_ARCH variable to add the possibility to bake m…
Browse files Browse the repository at this point in the history
…ulti-arch base images
  • Loading branch information
pmacius committed Aug 26, 2024
1 parent 9ecc71b commit aa87e96
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
```
6 changes: 6 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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" {
Expand Down Expand Up @@ -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" {
Expand Down

0 comments on commit aa87e96

Please sign in to comment.