docker-gradle
docker-gradle copied to clipboard
"latest" tag is confusing
The latest
tag is confusing, as it points to non-latest JDK. Perhaps the tag should point to the latest supported JDK for that latest Gradle version. Or perhaps there should be a different tag that is supposed to be latest JDK and latest Gradle, without specifying the Gradle/JDK version in the image tag.
Specifying the JDK version in the image/tag is less important now since Gradle 6.7 supports specifying JDK version in the build.gradle
. See https://docs.gradle.org/6.7/release-notes.html#new-jvm-ecosystem-features.
Even prior to Gradle 6.7, you were able to specify the source
and target
for javac. But there are situations in which that's insufficient for compatibility. And by default, Gradle uses the JVM version as the source
/target
. So not having the ability to specify the version might be inconvenient. Toolchains are mostly useful when you have multiple versions of Java to choose between on your system, which doesn't really apply in a Docker scenario.
It's my perception that many enterprise users prefer LTS versions because they like to use the same JVM for building as they do for runtime, and aren't able to accommodate the upgrade schedule of non-LTS versions since there is no overlap of support between non-LTS versions, which can be important for security reasons. As a result, I don't think marking the latest JDK as "latest" would be desirable.
There's lots of articles and blogs that discuss how "latest" is a misnomer. As they say in the official image docs,
In Docker, the latest tag is a special case, but it's a bit of a misnomer; latest really is the "default" tag. [...], so the image that it is an alias for should reflect which version or variation of the software users should use if they do not know or do not care which version they use.
However, I have thought about changing latest to be 11 instead of 8 now that 11 seems the most commonly deployed (at least from what I've seen), which it wasn't at the time these images were first created, but I didn't want to do so without some feedback from users first.
Expanding off of this, I think latest should point to jdk 17 once it is available, as it is both the most recent jdk and a LTS. I agree that latest should only point to a LTS.
I was reluctant to change it because I was concerned it might break folks and they still relied on Java 8. But since we gotta move off adoptopenjdk, it's a good opportunity to re-think this.
Another way we could go is to have an lts
tag for the latest LTS Java and latest
points to the latest Java (which might be LTS if there hasn't been a new release yet). That's what they do with the node image. With the eclipse-temurin image, you can see they had the latest Java (even if it wasn't an LTS version) as latest
.
I think what I would personally want is to have the latest LTS be latest, but maybe others feel differently (I've never worked for an employer that was constantly on the latest Java).
I think this is no longer relevant as I've now been keeping "latest" to the latest LTS Java.