From aa110608fa947020717d5ee05b6da4fefea642a4 Mon Sep 17 00:00:00 2001 From: Samruddhi Khandale Date: Thu, 28 Sep 2023 09:53:14 -0700 Subject: [PATCH] Support: Java 21 (#770) --- src/java/.devcontainer/Dockerfile | 2 +- src/java/README.md | 3 +- src/java/manifest.json | 50 ++++++++++++++++++++++++++----- 3 files changed, 46 insertions(+), 9 deletions(-) diff --git a/src/java/.devcontainer/Dockerfile b/src/java/.devcontainer/Dockerfile index 048738fa9..852f11588 100644 --- a/src/java/.devcontainer/Dockerfile +++ b/src/java/.devcontainer/Dockerfile @@ -1,5 +1,5 @@ # This Dockerfile uses separate build arguments instead of VARIANT -ARG TARGET_JAVA_VERSION=11 +ARG TARGET_JAVA_VERSION=21 ARG BASE_IMAGE_VERSION_CODENAME=bookworm FROM mcr.microsoft.com/devcontainers/base:${BASE_IMAGE_VERSION_CODENAME} diff --git a/src/java/README.md b/src/java/README.md index 56a402a57..e6f8b21cf 100644 --- a/src/java/README.md +++ b/src/java/README.md @@ -9,7 +9,7 @@ | *Categories* | Core, Languages | | *Image type* | Dockerfile | | *Published images* | mcr.microsoft.com/devcontainers/java | -| *Available image variants* | 11 / 11-bookworm, 17 / 17-bookworm, 11-bullseye, 17-bullseye, 11-buster, 17-buster ([full list](https://mcr.microsoft.com/v2/devcontainers/java/tags/list)) | +| *Available image variants* | 11 / 11-bookworm, 17 / 17-bookworm, 21 / 21-bookworm, 11-bullseye, 17-bullseye, 21-bullseye, 11-buster, 17-buster, 21-buster ([full list](https://mcr.microsoft.com/v2/devcontainers/java/tags/list)) | | *Published image architecture(s)* | x86-64, arm64/aarch64 for `bookworm`, and `bullseye` variants | | *Container host OS support* | Linux, macOS, Windows | | *Container OS* | Debian | @@ -22,6 +22,7 @@ See **[history](history)** for information on the contents of published images. You can directly reference pre-built versions of `Dockerfile` by using the `image` property in `.devcontainer/devcontainer.json` or updating the `FROM` statement in your own `Dockerfile` to one of the following. An example `Dockerfile` is included in this repository. - `mcr.microsoft.com/devcontainers/java` (latest) +- `mcr.microsoft.com/devcontainers/java:21` (or `21-bookworm`, `21-bullseye`, `21-buster` to pin to an OS version) - `mcr.microsoft.com/devcontainers/java:11` (or `17-bookworm`, `11-bullseye`, `11-buster` to pin to an OS version) - `mcr.microsoft.com/devcontainers/java:17` (or `17-bookworm`, `17-bullseye`, `17-buster` to pin to an OS version) diff --git a/src/java/manifest.json b/src/java/manifest.json index 15b6855a6..1c94a04e0 100644 --- a/src/java/manifest.json +++ b/src/java/manifest.json @@ -1,6 +1,9 @@ { "version": "1.0.3", "variants": [ + "21-bookworm", + "21-bullseye", + "21-buster", "17-bookworm", "17-bullseye", "17-buster", @@ -9,11 +12,15 @@ "11-buster" ], "build": { - "latest": "17-bookworm", + "latest": "21-bookworm", "rootDistro": "debian", "parent": "base-debian", "idMismatch": "true", "variantBuildArgs": { + "21-bookworm": { + "TARGET_JAVA_VERSION": "21", + "BASE_IMAGE_VERSION_CODENAME": "bookworm" + }, "17-bookworm": { "TARGET_JAVA_VERSION": "17", "BASE_IMAGE_VERSION_CODENAME": "bookworm" @@ -22,6 +29,10 @@ "TARGET_JAVA_VERSION": "11", "BASE_IMAGE_VERSION_CODENAME": "bookworm" }, + "21-bullseye": { + "TARGET_JAVA_VERSION": "21", + "BASE_IMAGE_VERSION_CODENAME": "bullseye" + }, "17-bullseye": { "TARGET_JAVA_VERSION": "17", "BASE_IMAGE_VERSION_CODENAME": "bullseye" @@ -30,6 +41,10 @@ "TARGET_JAVA_VERSION": "11", "BASE_IMAGE_VERSION_CODENAME": "bullseye" }, + "21-buster": { + "TARGET_JAVA_VERSION": "21", + "BASE_IMAGE_VERSION_CODENAME": "buster" + }, "17-buster": { "TARGET_JAVA_VERSION": "17", "BASE_IMAGE_VERSION_CODENAME": "buster" @@ -40,6 +55,10 @@ } }, "architectures": { + "21-bookworm": [ + "linux/amd64", + "linux/arm64" + ], "17-bookworm": [ "linux/amd64", "linux/arm64" @@ -48,6 +67,10 @@ "linux/amd64", "linux/arm64" ], + "21-bullseye": [ + "linux/amd64", + "linux/arm64" + ], "17-bullseye": [ "linux/amd64", "linux/arm64" @@ -56,6 +79,9 @@ "linux/amd64", "linux/arm64" ], + "21-buster": [ + "linux/amd64" + ], "17-buster": [ "linux/amd64" ], @@ -67,26 +93,36 @@ "java:${VERSION}-${VARIANT}" ], "variantTags": { + "21-bookworm": [ + "java:${VERSION}-21", + "java:${VERSION}-21-jdk-bookworm", + "java:${VERSION}-bookworm" + ], "17-bookworm": [ "java:${VERSION}-17", - "java:${VERSION}-17-jdk-bookworm", - "java:${VERSION}-bookworm" + "java:${VERSION}-17-jdk-bookworm" ], "11-bookworm": [ "java:${VERSION}-11", "java:${VERSION}-11-jdk-bookworm" ], - "17-bullseye": [ - "java:${VERSION}-17-jdk-bullseye", + "21-bullseye": [ + "java:${VERSION}-21-jdk-bullseye", "java:${VERSION}-bullseye" ], + "17-bullseye": [ + "java:${VERSION}-17-jdk-bullseye" + ], "11-bullseye": [ "java:${VERSION}-11-jdk-bullseye" ], - "17-jdk-buster": [ - "java:${VERSION}-17-jdk-buster", + "21-jdk-buster": [ + "java:${VERSION}-21-jdk-buster", "java:${VERSION}-buster" ], + "17-jdk-buster": [ + "java:${VERSION}-17-jdk-buster" + ], "11-buster": [ "java:${VERSION}-11-jdk-buster" ]