microsoft / vscode-dev-containers

NOTE: Most of the contents of this repository have been migrated to the new devcontainers GitHub org (https://github.com/devcontainers). See https://github.com/devcontainers/template-starter and https://github.com/devcontainers/feature-starter for information on creating your own!
https://aka.ms/vscode-remote
MIT License
4.72k stars 1.41k forks source link

mcr.microsoft.com/vscode/devcontainers/java:{17|0-17|0-17-bullseye} does not contain java 17 but java 11 #1619

Closed RyuSA closed 2 years ago

RyuSA commented 2 years ago

$ cat /etc/os-release NAME="Ubuntu" VERSION="20.04.4 LTS (Focal Fossa)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.04.4 LTS" VERSION_ID="20.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=focal UBUNTU_CODENAME=focal

$ arch x86_64


- Reproduces in: Both
- Name of Dev Container Definition with Issue: Java

Steps to Reproduce:
1. docker run --rm -it mcr.microsoft.com/vscode/devcontainers/java:17 java -version

<img width="485" alt="image" src="https://user-images.githubusercontent.com/12961775/188898854-5c155e0e-ed3d-4a82-a306-6a9a14c71268.png">

## Bug summary
I found the Java base container images named ` mcr.microsoft.com/vscode/devcontainers/java:17` contains only JDK 11.

```bash
$ docker run --rm -it mcr.microsoft.com/vscode/devcontainers/java:0-17 bash
root āžœ / $ env | grep JAVA
JAVA_HOME=/usr/lib/jvm/msopenjdk-11
root āžœ / $ ls -al /usr/lib/jvm
total 12
drwxr-xr-x 3 root root 4096 Sep  1 23:05 .
drwxr-xr-x 1 root root 4096 Sep  1 23:05 ..
drwxr-xr-x 9 root root 4096 Sep  1 23:05 msopenjdk-11
root āžœ / $ /usr/lib/jvm/msopenjdk-11/bin/java -version
openjdk version "11.0.16.1" 2022-08-12 LTS
OpenJDK Runtime Environment Microsoft-40648 (build 11.0.16.1+1-LTS)
OpenJDK 64-Bit Server VM Microsoft-40648 (build 11.0.16.1+1-LTS, mixed mode)

I didn't notifythe bug since I used local image cache long time for my devcontainer environment. But when I tried to rebuild the container image without cache, I got a build error today which said "hey, this container does not have java 17 but java 11".

I think the images must contain Java 17 to set up for Java 17 development environment. Isn't it expected behavier?

Thank you,

RyuSA commented 2 years ago

Quick workaround: use a semantic version tag. current latest version is 0.205.5 https://github.com/microsoft/vscode-dev-containers/blob/main/containers/java/history/0.205.5.md

$ docker run --rm -it mcr.microsoft.com/vscode/devcontainers/java:0.205.5-17 java -version
openjdk version "17.0.4" 2022-07-19 LTS
OpenJDK Runtime Environment Microsoft-38107 (build 17.0.4+8-LTS)
OpenJDK 64-Bit Server VM Microsoft-38107 (build 17.0.4+8-LTS, mixed mode, sharing)
eitsupi commented 2 years ago

I think this issue is tracked on devcontainers/images#102

RyuSA commented 2 years ago

oh, I didn't know the issue thanks.

the change will be synced to this repo too?

eitsupi commented 2 years ago

the change will be synced to this repo too?

The source repository for that image has recently been changed from here to there. Please see #1589.

RyuSA commented 2 years ago

Thanks a lot @eitsupi ! šŸ‘ Let me close the issue.