images icon indicating copy to clipboard operation
images copied to clipboard

Install JDK 11 / 17 as a DEB package for auto-updates

Open brunoborges opened this issue 2 years ago • 2 comments

Currently, the JDK is installed using the tar.gz package. This leaves users with an old version as soon as the dev container is older than 3 months, since new JDK updates are released quarterly.

Instead, the JDK may be installed using the Linux package manager (apt or apt-get). This way, the user can be notified by the Linux system of the presence of older packages as soon as a newer version is released, automatically.

To accomplish this, the Java devcontainers must change how the JDK is installed.

Dev container source files

  • Java: https://github.com/devcontainers/images/blob/main/src/java/.devcontainer/Dockerfile

How to install JDK using Linux's apt

  • JDK 11 and 17 (Microsoft Build of OpenJKD): https://learn.microsoft.com/en-us/java/openjdk/install#install-on-ubuntu

brunoborges avatar Mar 29 '23 17:03 brunoborges

Hi 👋

This is an interesting feedback, thank you! We currently publish the java images for debian OS (bullseye and buster). So installing it with linux package manager should be possible.

This leaves users with an old version as soon as the dev container is older than 3 months, since new JDK updates are released quarterly.

I agree, however, if users rebuild their dev container, then they should get the latest JDK (patch version) via the latest images release (we publish all the dev container images at least once every month).

Wondering, @brunoborges are you familiar with how soon the apt packages are updated after new JDK versions are released? I think it should be around same time as the packages are available in microsoft packages registry, however, would be nice to know.

samruddhikhandale avatar Mar 29 '23 23:03 samruddhikhandale

Wondering, @brunoborges are you familiar with how soon the apt packages are updated after new JDK versions are released? I think it should be around same time as the packages are available in microsoft packages registry, however, would be nice to know.

The Microsoft Build of OpenJDK apt packages are only published through the Microsoft Packages registry.

brunoborges avatar Apr 18 '23 17:04 brunoborges