Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
pmacius committed Aug 28, 2024
1 parent 7bd71aa commit a8873bc
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 7 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ jobs:

- name: Bake Docker images
uses: docker/bake-action@a4d7f0b5b91c14a296d792d4ec53a9db17f02e67 # v5.5.0
env:
TARGET_ARCH: "linux/amd64,linux/arm64"
with:
push: true

Expand Down
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,19 @@ 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

arm64_supported: docker-bake.hcl prepare_all
@echo "Building all supported images for arm64"
@export TARGET_ARCH="linux/arm64"
@docker buildx bake --no-cache --progress=plain java_base

all: docker-bake.hcl prepare_all
@echo "Building all images"
@docker buildx bake --no-cache --progress=plain
Expand Down
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ types of files in the right locations:

## 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`.
The image architecture defaults to the building system's architecture when the
`TARGET_ARCH` is empty. To modify it, you need to adjust variable in the Bake
file to a specific architecture, such as `linux/amd64`.

```
Expand All @@ -51,3 +51,16 @@ variable "TARGET_ARCH" {
}
```

Setting the var to a `linux/arm64` or `linux/amd64` will result in creating
images that are currently supporting multi platform. There is also other way to
set the target architecture:

```sh

docker buildx bake --set *.platform=linux/arm64

```

Simply use the above command to set the target platform for every image.
Warning: currently we are not supporting every image on `linux/arm64` arch.
3 changes: 1 addition & 2 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ target "java_base" {
}
tags = ["${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-base-java:${JDIST}${JAVA_MAJOR}-${DISTRIB_NAME}${DISTRIB_MAJOR}"]
output = ["type=cacheonly"]
platforms = split(",", TARGET_ARCH)
platforms = ["${TARGET_ARCH}"]
}

variable "TOMCAT_MAJOR" {
Expand Down Expand Up @@ -183,7 +183,6 @@ target "tomcat_base" {
}
tags = ["${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-base-tomcat:tomcat${TOMCAT_MAJOR}-${JDIST}${JAVA_MAJOR}-${DISTRIB_NAME}${DISTRIB_MAJOR}"]
output = ["type=cacheonly"]
platforms = split(",", TARGET_ARCH)
}

target "repository" {
Expand Down

0 comments on commit a8873bc

Please sign in to comment.