Skip to content

Commit

Permalink
variabilise jdks to build in docker bake
Browse files Browse the repository at this point in the history
  • Loading branch information
lemeurherve committed Jun 9, 2024
1 parent 45d3aaa commit 231fc6f
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ group "linux-ppc64le" {
]
}

variable "jdks_to_build" {
default = [11, 17, 21]
}

variable "default_jdk" {
default = 17
}

variable "REGISTRY" {
default = "docker.io"
}
Expand Down Expand Up @@ -76,10 +84,7 @@ variable "DEBIAN_RELEASE" {
default = "bookworm-20240513"
}

variable "default_jdk" {
default = 17
}

## Common functions
# Return "true" if the jdk passed as parameter is the same as the default jdk, "false" otherwise
function "is_default_jdk" {
params = [jdk]
Expand All @@ -96,6 +101,7 @@ function "javaversion" {
: "${JAVA21_VERSION}"))
}

# Specific functions
# Return an array of Alpine platforms to use depending on the jdk passed as parameter
function "alpine_platforms" {
params = [jdk]
Expand All @@ -114,7 +120,7 @@ function "debian_platforms" {

target "alpine" {
matrix = {
jdk = [11, 17, 21]
jdk = jdks_to_build
}
name = "alpine_${jdk}"
dockerfile = "alpine/Dockerfile"
Expand All @@ -141,7 +147,7 @@ target "alpine" {

target "debian" {
matrix = {
jdk = [11, 17, 21]
jdk = jdks_to_build
}
name = "debian_${jdk}"
dockerfile = "debian/Dockerfile"
Expand Down

0 comments on commit 231fc6f

Please sign in to comment.