Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
pmacius committed Aug 28, 2024
1 parent 70ed96a commit 56f3871
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 37 deletions.
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ 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
31 changes: 4 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,42 +40,19 @@ types of files in the right locations:

## Architecture choice

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`.

```
variable "TARGET_ARCH" {
default = "linux/amd64"
}
```

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:
The image architecture defaults to the building system's architecture. To modify
it, you need to adjust variable when running bake command.

```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.

Other way to override `TARGET_ARCH` using the Makefile:

```makefile
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
```
To build just a specific image use e.g.:

```sh

make arm64_supported
docker buildx bake --set java_base.platform=linux/amd64 java_base

```
5 changes: 0 additions & 5 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@ variable "ALFRESCO_REPO_USER_NAME" {
default = "alfresco"
}

variable "TARGET_ARCH" {
default = ""
}

target "java_base" {
context = "./java"
dockerfile = "Dockerfile"
Expand Down Expand Up @@ -139,7 +135,6 @@ target "java_base" {
}
tags = ["${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-base-java:${JDIST}${JAVA_MAJOR}-${DISTRIB_NAME}${DISTRIB_MAJOR}"]
output = ["type=cacheonly"]
platforms = ["${TARGET_ARCH}"]
}

variable "TOMCAT_MAJOR" {
Expand Down

0 comments on commit 56f3871

Please sign in to comment.