Skip to content

Commit

Permalink
Merge pull request #419 from lemeurherve/issue418-deduplicated-list-o…
Browse files Browse the repository at this point in the history
…f-jdks-to-build

chore: define jdks to build at a single place in docker bake
  • Loading branch information
dduportal authored Jun 18, 2024
2 parents f922ca6 + e165514 commit cc64011
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 @@ -25,6 +25,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 @@ -65,10 +73,7 @@ variable "DEBIAN_RELEASE" {
default = "bookworm-20240612"
}

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 @@ -85,6 +90,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 @@ -103,7 +109,7 @@ function "debian_platforms" {

target "alpine" {
matrix = {
jdk = [11, 17, 21]
jdk = jdks_to_build
}
name = "alpine_${jdk}"
dockerfile = "alpine/Dockerfile"
Expand All @@ -130,7 +136,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 cc64011

Please sign in to comment.