Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[java] - add jdk 23 to be supported latest version #1220

Closed
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 25 additions & 9 deletions src/java/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This Dockerfile uses separate build arguments instead of VARIANT
ARG TARGET_JAVA_VERSION=21
ARG TARGET_JAVA_VERSION=23
ARG BASE_IMAGE_VERSION_CODENAME=bookworm
FROM mcr.microsoft.com/devcontainers/base:${BASE_IMAGE_VERSION_CODENAME}

Expand All @@ -14,21 +14,37 @@ ENV LANG en_US.UTF-8
RUN arch="$(dpkg --print-architecture)" \
&& case "$arch" in \
"amd64") \
if [ "$TARGET_JAVA_VERSION" -gt 21 ]; then \
jdkUrl="https://download.oracle.com/java/${TARGET_JAVA_VERSION}/latest/jdk-${TARGET_JAVA_VERSION}_linux-x64_bin.tar.gz"; \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure oracle version of java is what we need?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jdk 23 not yet available from aka.ms. Is this PR really necessary then ?

else \
jdkUrl="https://aka.ms/download-jdk/microsoft-jdk-${TARGET_JAVA_VERSION}-linux-x64.tar.gz"; \
;; \
"arm64") \
fi \
;; \
"arm64") \
if [ "$TARGET_JAVA_VERSION" -gt 21 ]; then \
jdkUrl="https://download.oracle.com/java/${TARGET_JAVA_VERSION}/latest/jdk-${TARGET_JAVA_VERSION}_linux-aarch64_bin.tar.gz"; \
else \
jdkUrl="https://aka.ms/download-jdk/microsoft-jdk-${TARGET_JAVA_VERSION}-linux-aarch64.tar.gz"; \
;; \
fi \
;; \
*) echo >&2 "error: unsupported architecture: '$arch'"; exit 1 ;; \
esac \
\
&& wget --progress=dot:giga -O msopenjdk.tar.gz "${jdkUrl}" \
&& wget --progress=dot:giga -O sha256sum.txt "${jdkUrl}.sha256sum.txt" \
&& wget --progress=dot:giga -O msopenjdk.tar.gz "${jdkUrl}" \
&& if [ "$TARGET_JAVA_VERSION" -gt 21 ]; then \
wget --progress=dot:giga -O jdk-${TARGET_JAVA_VERSION}_linux-${arch}_sha256 "${jdkUrl}.sha256"; \
else \
wget --progress=dot:giga -O jdk-${TARGET_JAVA_VERSION}_linux-${arch}_sha256sum.txt "${jdkUrl}.sha256sum.txt"; \
fi \
\
&& sha256sumText=$(cat sha256sum.txt) \
&& sha256=$(expr substr "${sha256sumText}" 1 64) \
&& if [ "$TARGET_JAVA_VERSION" -gt 21 ]; then \
sha256sumText=$(cat jdk-${TARGET_JAVA_VERSION}_linux-${arch}_sha256); \
else \
sha256sumText=$(cat jdk-${TARGET_JAVA_VERSION}_linux-${arch}_sha256sum.txt); \
fi \
&& sha256=$(echo "${sha256sumText}" | awk '{print $1}') \
&& echo "${sha256} msopenjdk.tar.gz" | sha256sum --strict --check - \
&& rm sha256sum.txt* \
&& rm jdk-${TARGET_JAVA_VERSION}_linux-${arch}_sha256* \
\
&& mkdir -p "$JAVA_HOME" \
&& tar --extract \
Expand Down
3 changes: 2 additions & 1 deletion src/java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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, 21 / 21-bookworm, 11-bullseye, 17-bullseye, 21-bullseye ([full list](https://mcr.microsoft.com/v2/devcontainers/java/tags/list)) |
| *Available image variants* | 11 / 11-bookworm, 17 / 17-bookworm, 21 / 21-bookworm, 23 / 23-bookworm, 11-bullseye, 17-bullseye, 21-bullseye, 23-bullseye ([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 |
Expand All @@ -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:23` (or `23-bookworm`, `23-bullseye` to pin to an OS version)
- `mcr.microsoft.com/devcontainers/java:21` (or `21-bookworm`, `21-bullseye` to pin to an OS version)
- `mcr.microsoft.com/devcontainers/java:11` (or `17-bookworm`, `11-bullseye` to pin to an OS version)
- `mcr.microsoft.com/devcontainers/java:17` (or `17-bookworm`, `17-bullseye` to pin to an OS version)
Expand Down
29 changes: 28 additions & 1 deletion src/java/manifest.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
{
"version": "1.1.15",
"variants": [
"23-bookworm",
"21-bookworm",
"23-bullseye",
"21-bullseye",
"17-bookworm",
"17-bullseye",
"11-bookworm",
"11-bullseye"
],
"build": {
"latest": "21-bookworm",
"latest": "23-bookworm",
"rootDistro": "debian",
"parent": "base-debian",
"idMismatch": "true",
"variantBuildArgs": {
"23-bookworm": {
"TARGET_JAVA_VERSION": "23",
"BASE_IMAGE_VERSION_CODENAME": "bookworm"
},
"21-bookworm": {
"TARGET_JAVA_VERSION": "21",
"BASE_IMAGE_VERSION_CODENAME": "bookworm"
Expand All @@ -26,6 +32,10 @@
"TARGET_JAVA_VERSION": "11",
"BASE_IMAGE_VERSION_CODENAME": "bookworm"
},
"23-bullseye": {
"TARGET_JAVA_VERSION": "23",
"BASE_IMAGE_VERSION_CODENAME": "bullseye"
},
"21-bullseye": {
"TARGET_JAVA_VERSION": "21",
"BASE_IMAGE_VERSION_CODENAME": "bullseye"
Expand All @@ -40,6 +50,10 @@
}
},
"architectures": {
"23-bookworm": [
"linux/amd64",
"linux/arm64"
],
"21-bookworm": [
"linux/amd64",
"linux/arm64"
Expand All @@ -52,6 +66,10 @@
"linux/amd64",
"linux/arm64"
],
"23-bullseye": [
"linux/amd64",
"linux/arm64"
],
"21-bullseye": [
"linux/amd64",
"linux/arm64"
Expand All @@ -69,6 +87,11 @@
"java:${VERSION}-${VARIANT}"
],
"variantTags": {
"23-bookworm": [
"java:${VERSION}-23",
"java:${VERSION}-23-jdk-bookworm",
"java:${VERSION}-bookworm"
],
"21-bookworm": [
"java:${VERSION}-21",
"java:${VERSION}-21-jdk-bookworm",
Expand All @@ -82,6 +105,10 @@
"java:${VERSION}-11",
"java:${VERSION}-11-jdk-bookworm"
],
"23-bullseye": [
"java:${VERSION}-23-jdk-bullseye",
"java:${VERSION}-bullseye"
],
"21-bullseye": [
"java:${VERSION}-21-jdk-bullseye",
"java:${VERSION}-bullseye"
Expand Down
Loading