Skip to content

Commit

Permalink
[UPDATE] 更新 OpenJDK 版本号
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Yeh <[email protected]>
  • Loading branch information
alan-yeh committed Feb 29, 2024
1 parent 8e73856 commit d65a42e
Show file tree
Hide file tree
Showing 14 changed files with 153 additions and 93 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/openjdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,36 @@ name: Release OpenJDK Images

on:
workflow_dispatch:
inputs:
version:
description: 'OpenJDK Version'
required: true
default: 'all'
type: choice
options:
- 'all'
- '8'
- '11'
- '17'
- '21'
java:
description: 'OpenJDK/JRE'
required: true
default: 'all'
type: choice
options:
- 'all'
- 'jdk'
- 'jre'
os:
description: 'OS for base image'
required: true
default: 'all'
type: choice
options:
- 'all'
- 'ubuntu'
- 'alpine'

jobs:
#################################################################
Expand Down Expand Up @@ -33,6 +63,10 @@ jobs:
#============================ Build ============================
- name: Release Images
uses: docker/bake-action@v4
env:
ENV_VERSION: ${{ github.event.inputs.version }}
ENV_JAVA: ${{ github.event.inputs.java }}
ENV_OS: ${{ github.event.inputs.os }}
with:
targets: openjdk
workdir: ./openjdk
Expand Down
2 changes: 1 addition & 1 deletion android/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ target "_labels" {
labels = {
"org.opencontainers.image.description" = "Android Packaged by CentralX"
"org.opencontainers.image.vendor" = "CentralX"
"org.opencontainers.image.maintainer" = "Alan Yeh <alan.yeh.cn>"
"org.opencontainers.image.maintainer" = "Alan Yeh <alan@yeh.cn>"
}
}

Expand Down
2 changes: 1 addition & 1 deletion busybox/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ target "_labels" {
"org.opencontainers.image.title" = "busybox"
"org.opencontainers.image.description" = "Busybox"
"org.opencontainers.image.vendor" = "CentralX"
"org.opencontainers.image.maintainer" = "Alan Yeh <alan.yeh.cn>"
"org.opencontainers.image.maintainer" = "Alan Yeh <alan@yeh.cn>"
}
}

Expand Down
2 changes: 1 addition & 1 deletion clash/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ target "_labels" {
"org.opencontainers.image.title" = "clash"
"org.opencontainers.image.description" = "Clash with Dashboard"
"org.opencontainers.image.vendor" = "CentralX"
"org.opencontainers.image.maintainer" = "Alan Yeh <alan.yeh.cn>"
"org.opencontainers.image.maintainer" = "Alan Yeh <alan@yeh.cn>"
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ target "_labels" {
labels = {
"org.opencontainers.image.description" = "Gradle Packaged by CentralX"
"org.opencontainers.image.vendor" = "CentralX"
"org.opencontainers.image.maintainer" = "Alan Yeh <alan.yeh.cn>"
"org.opencontainers.image.maintainer" = "Alan Yeh <alan@yeh.cn>"
}
}

Expand Down
2 changes: 1 addition & 1 deletion hbase/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ target "_labels" {
"org.opencontainers.image.title" = "hbase"
"org.opencontainers.image.description" = "Apache HBase"
"org.opencontainers.image.vendor" = "CentralX"
"org.opencontainers.image.maintainer" = "Alan Yeh <alan.yeh.cn>"
"org.opencontainers.image.maintainer" = "Alan Yeh <alan@yeh.cn>"
}
}

Expand Down
2 changes: 1 addition & 1 deletion install-fonts/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ target "_labels" {
"org.opencontainers.image.title" = "install-fonts"
"org.opencontainers.image.description" = "Install Fonts"
"org.opencontainers.image.vendor" = "CentralX"
"org.opencontainers.image.maintainer" = "Alan Yeh <alan.yeh.cn>"
"org.opencontainers.image.maintainer" = "Alan Yeh <alan@yeh.cn>"
}
}

Expand Down
2 changes: 1 addition & 1 deletion install-pinpoint-java-agent/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ target "_labels" {
"org.opencontainers.image.title" = "install-pinpoint-java-agent"
"org.opencontainers.image.description" = "Install Pinpoint Java Agent"
"org.opencontainers.image.vendor" = "CentralX"
"org.opencontainers.image.maintainer" = "Alan Yeh <alan.yeh.cn>"
"org.opencontainers.image.maintainer" = "Alan Yeh <alan@yeh.cn>"
}
}

Expand Down
2 changes: 1 addition & 1 deletion maven/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ target "_labels" {
labels = {
"org.opencontainers.image.description" = "Maven Packaged by CentralX"
"org.opencontainers.image.vendor" = "CentralX"
"org.opencontainers.image.maintainer" = "Alan Yeh <alan.yeh.cn>"
"org.opencontainers.image.maintainer" = "Alan Yeh <alan@yeh.cn>"
}
}

Expand Down
2 changes: 1 addition & 1 deletion nexus3/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ target "_labels" {
"org.opencontainers.image.title" = "Nexus Repository Manager"
"org.opencontainers.image.description" = "The Nexus Repository Manager server with universal support for popular component formats."
"org.opencontainers.image.vendor" = "CentralX"
"org.opencontainers.image.maintainer" = "Alan Yeh <alan.yeh.cn>"
"org.opencontainers.image.maintainer" = "Alan Yeh <alan@yeh.cn>"
}
}

Expand Down
188 changes: 107 additions & 81 deletions openjdk/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -7,108 +7,134 @@
# Groups
#***************************************************************************
group "default" {
targets = [
"openjdk"
]
targets = [
"openjdk"
]
}

#***************************************************************************
# Global inheritable target
#***************************************************************************
target "_platforms" {
platforms = [
"linux/arm64",
"linux/amd64"
]
platforms = [
"linux/arm64",
"linux/amd64"
]
}

target "_labels" {
labels = {
"org.opencontainers.image.vendor" = "CentralX"
"org.opencontainers.image.maintainer" = "Alan Yeh <alan.yeh.cn>"
}
labels = {
"org.opencontainers.image.vendor" = "CentralX"
"org.opencontainers.image.maintainer" = "Alan Yeh <[email protected]>"
}
}

#***************************************************************************
# Global Function
#***************************************************************************
variable "ENV_VERSION" {
default = "all"
}

variable "ENV_JAVA" {
default = "all"
}

variable "ENV_OS" {
default = "all"
}

#***************************************************************************
# Global Function
#***************************************************************************
function "if" {
params = [condition, true_return]
result = condition ? true_return : ""
params = [condition, true_return]
result = condition ? [true_return] : []
}

#***************************************************************************
# Targets
#***************************************************************************
target "openjdk" {
name = "openjdk-${java}${replace(version.code, ".", "_")}-${os.name}"
matrix = {
// 版本
version = [{
// 8
major = "8"
code = "8.0.402"
zulu = "8.76.0.17"
}, {
// 11
major = "11"
code = "11.0.22"
zulu = "11.70.15"
}, {
// 17
major = "17"
code = "17.0.10"
zulu = "17.48.15"
}, {
// 21
major = "21"
code = "21.0.2"
zulu = "21.32.17"
}]
// java 类型
java = ["jdk", "jre"]
// 基础镜像发行版类型
os = [{
// ubuntu
name = "ubuntu"
image = "docker-image://ubuntu:jammy"
description = "Ubuntu Jammy"
suffix = ""
}, {
// alpine
name = "alpine"
image = "docker-image://alpine:3"
description = "Alpine 3"
suffix = "_musl"
}]
}
contexts = {
image = os.image
}
inherits = ["_platforms", "_labels"]
dockerfile = "Dockerfile"
labels = {
"org.opencontainers.image.title" = "open${java}"
"org.opencontainers.image.description" = "Azul Zulu Builds of Open${upper(java)} Packaged by CentralX"
"org.opencontainers.image.distribution" = os.description
"org.opencontainers.image.version" = version.code
}
args = {
VERSION = version.code
TARGET = "${java}"
AMD64_PACKAGE = "https://cdn.azul.com/zulu/bin/zulu${version.zulu}-ca-${java}${version.code}-linux${os.suffix}_x64.tar.gz"
ARM64_PACKAGE = "https://cdn.azul.com/zulu/bin/zulu${version.zulu}-ca-${java}${version.code}-linux${os.suffix}_aarch64.tar.gz"
}
tags = [
// ubuntu 且 jdk 时才有的 tag
if(and(equal("ubuntu", os.name), equal("jdk", java)), "docker.io/centralx/openjdk:${version.major}"),
if(and(equal("ubuntu", os.name), equal("jdk", java)), "docker.io/centralx/openjdk:${version.code}"),
name = "openjdk-${java}${replace(version.code, ".", "_")}-${os.name}"
matrix = {
// 版本
version = flatten([
// 8
if(contains(["all", "8"], "${ENV_VERSION}"), {
major = "8"
code = "8.0.402"
zulu = "8.76.0.17"
}),
// 11
if(contains(["all", "11"], "${ENV_VERSION}"), {
major = "11"
code = "11.0.22"
zulu = "11.70.15"
}),
// 17
if(contains(["all", "17"], "${ENV_VERSION}"), {
major = "17"
code = "17.0.10"
zulu = "17.48.15"
}),
// 21
if(contains(["all", "21"], "{$ENV_VERSION}"), {
major = "21"
code = "21.0.2"
zulu = "21.32.17"
})
])
// java 类型
java = flatten([
if(contains(["all", "jdk"], "${ENV_JAVA}"), "jdk"),
if(contains(["all", "jre"], "${ENV_JAVA}"), "jre")
])
// 基础镜像发行版类型
os = flatten([
// ubuntu
if(contains(["all", "ubuntu"], "${ENV_OS}"), {
name = "ubuntu"
image = "docker-image://ubuntu:jammy"
description = "Ubuntu Jammy"
suffix = ""
}),
// alpine
if(contains(["all", "alpine"], "${ENV_OS}"), {
name = "alpine"
image = "docker-image://alpine:3"
description = "Alpine 3"
suffix = "_musl"
})
])
}
contexts = {
image = os.image
}
inherits = ["_platforms", "_labels"]
dockerfile = "Dockerfile"
labels = {
"org.opencontainers.image.title" = "open${java}"
"org.opencontainers.image.description" = "Azul Zulu Builds of Open${upper(java)} Packaged by CentralX"
"org.opencontainers.image.distribution" = os.description
"org.opencontainers.image.version" = version.code
}
args = {
VERSION = version.code
TARGET = "${java}"
AMD64_PACKAGE = "https://cdn.azul.com/zulu/bin/zulu${version.zulu}-ca-${java}${version.code}-linux${os.suffix}_x64.tar.gz"
ARM64_PACKAGE = "https://cdn.azul.com/zulu/bin/zulu${version.zulu}-ca-${java}${version.code}-linux${os.suffix}_aarch64.tar.gz"
}
tags = flatten([
// ubuntu 且 jdk 时才有的 tag
if(and(equal("ubuntu", os.name), equal("jdk", java)), "docker.io/centralx/openjdk:${version.major}"),
if(and(equal("ubuntu", os.name), equal("jdk", java)), "docker.io/centralx/openjdk:${version.code}"),

// ubuntu 才有的 tag,alpine 没有
if(equal("ubuntu", os.name), "docker.io/centralx/openjdk:${java}${version.major}"),
if(equal("ubuntu", os.name), "docker.io/centralx/openjdk:${java}${version.code}"),
// ubuntu 才有的 tag,alpine 没有
if(equal("ubuntu", os.name), "docker.io/centralx/openjdk:${java}${version.major}"),
if(equal("ubuntu", os.name), "docker.io/centralx/openjdk:${java}${version.code}"),

"docker.io/centralx/openjdk:${java}${version.major}-${os.name}",
"docker.io/centralx/openjdk:${java}${version.code}-${os.name}"
]
"docker.io/centralx/openjdk:${java}${version.major}-${os.name}",
"docker.io/centralx/openjdk:${java}${version.code}-${os.name}"
])
}
2 changes: 1 addition & 1 deletion resources-installer/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ target "_labels" {
"org.opencontainers.image.title" = "resources-installer"
"org.opencontainers.image.description" = "Install resources"
"org.opencontainers.image.vendor" = "CentralX"
"org.opencontainers.image.maintainer" = "Alan Yeh <alan.yeh.cn>"
"org.opencontainers.image.maintainer" = "Alan Yeh <alan@yeh.cn>"
}
}

Expand Down
2 changes: 1 addition & 1 deletion spring-runner/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ target "_labels" {
"org.opencontainers.image.title" = "spring-runner"
"org.opencontainers.image.description" = "Spring Application Runner packaged by CentralX"
"org.opencontainers.image.vendor" = "CentralX"
"org.opencontainers.image.maintainer" = "Alan Yeh <alan.yeh.cn>"
"org.opencontainers.image.maintainer" = "Alan Yeh <alan@yeh.cn>"
}
}

Expand Down
2 changes: 1 addition & 1 deletion waitfor/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ target "_labels" {
"org.opencontainers.image.title" = "waitfor"
"org.opencontainers.image.description" = "Wait for"
"org.opencontainers.image.vendor" = "CentralX"
"org.opencontainers.image.maintainer" = "Alan Yeh <alan.yeh.cn>"
"org.opencontainers.image.maintainer" = "Alan Yeh <alan@yeh.cn>"
}
}

Expand Down

0 comments on commit d65a42e

Please sign in to comment.