Skip to content

Conversation

@NColey
Copy link
Contributor

@NColey NColey commented Jan 9, 2026

Sbt Native Packager uses openjdk:8 as the default Docker image. This version has been removed from the docker registry, posing issues for projects trying to incorporate sbt-native-packager today, who encounter the following error:

[info] #0 building with "desktop-linux" instance using docker driver
[info] #1 [internal] load build definition from Dockerfile
[info] #1 transferring dockerfile: 1.37kB done
[info] #1 DONE 0.0s
[info] #2 [auth] library/openjdk:pull token for registry-1.docker.io
[info] #2 DONE 0.0s
[info] #3 [internal] load metadata for docker.io/library/openjdk:8
[info] #3 ERROR: docker.io/library/openjdk:8: not found
[info] ------
[info]  > [internal] load metadata for docker.io/library/openjdk:8:
[info] ------
[info] Dockerfile:1
[info] --------------------
[info]    1 | >>> FROM openjdk:8 AS stage0
[info]    2 |     LABEL snp-multi-stage="intermediate"
[info]    3 |     LABEL snp-multi-stage-id="e456cb60-d8be-4f7e-9ca5-d70df942bd65"
[info] --------------------
[info] ERROR: failed to build: failed to solve: openjdk:8: failed to resolve source metadata for docker.io/library/openjdk:8: docker.io/library/openjdk:8: not found

It also appears to be breaking sbt-native-packagers own builds (see latest commit here) and open PRs (e.g here). This is applicable also to openjdk:9 and openjdk:10.

There is an issue in the project opened just under a year ago discussing replacing openjdk:8 with a newer image but as of the latest comment 2 months ago it seems like there is not yet alignment on what to replace openjdk:8 with.

This PR upgrades to the latest LTS of eclipse-temurin (eclipse-temurin:25) for the base image. Where openjdk:8, openjdk:9, and openjdk:10 appear in tests they have been replaced with eclipse-temurin:8, eclipse-temurin:11, and eclipse-temurin:17 respectively.

An alternate approach (if desired) from an earlier version of this PR description could be to replace with the explicit openjdk:8 tag of openjdk:8u342 in line with this suggestion from the docker-library/openjdk repo, full list of tags also mentioned here.

@muuki88
Copy link
Contributor

muuki88 commented Jan 9, 2026

Hi @NColey

Thanks a lot for tackling this 🙏 ❤️

I'm fine merging this. However if you have the time to upgrade the JDK to the latest LTS version of openjdk or eclipse-temurin. JDK 8 needs to get out of here finally 😅

@NColey
Copy link
Contributor Author

NColey commented Jan 9, 2026

if you have the time to upgrade the JDK to the latest LTS version of openjdk or eclipse-temurin. JDK 8 needs to get out of here finally 😅

Np! Happy to update, I can use eclipse-temurin:25 which is the latest LTS and what I see referenced in the open project issue as well.

A note though -- I see in sbt-test/docker/jdk-versions there are sample projects & tests validating use of jdk 9 and 10 as a dockerBaseImage, currently these use opendjk:9 and openjdk:10. Both have the same issue as openjdk:8 in that they are no longer available in the docker registry. You can see a sample error for openjdk:10-jre here. However unlike openjdk:8 (which has an equivalent in eclipse-temurin:8) there is only the option of the explicit opendjk tags (openjdk:9.0.4-12 and openjdk:10.0.2-13 respectively).

Is there an objection to upgrading to eclipse-temurin:25 for the base image but having the jdk9 and jdk10 tests switch to the explicit openjdk tags to facilitate those tests? If this is fine, is there somewhere I should note this discrepancy (e.g in a comment, README, etc)?

@muuki88
Copy link
Contributor

muuki88 commented Jan 9, 2026

Those tests were added when those JDKs were new and shiny 🙈 I guess, we could update those to up-to-date JDK versions as well, like newer ones than the current temurin LTS. Feel free to update all openjdk to temurin 😊

@NColey NColey marked this pull request as ready for review January 9, 2026 20:23
@NColey
Copy link
Contributor Author

NColey commented Jan 9, 2026

Feel free to update all openjdk to temurin 😊

Sounds good! I made the updates + revised the PR description to better reflect that this is suggesting an upgrade to eclipse-temurin:25 rather than use of the explicit openjdk:8 tag. Let me know if there is anything else I could or should add here 🙏

@NColey
Copy link
Contributor Author

NColey commented Jan 9, 2026

Also, out of curiosity -- what does the release cadence look like for this library? I ask because I noticed the openjdk:8 issue from it surfacing in a new project at my organization (which already uses sbt-native-packager elsewhere).

I'm wondering, if this PR were to be accepted, when would it be likely to turn up in a new release? Completely understand if there isn't a set cadence, but I thought I would ask just to get a better sense. Thank you!

@NColey NColey changed the title Use explicit openjdk:8 Tag Use eclipse-temurin:25 For Base Image Jan 9, 2026
@muuki88
Copy link
Contributor

muuki88 commented Jan 12, 2026

I would immediately release it 😊

@muuki88 muuki88 merged commit 3e44fab into sbt:main Jan 12, 2026
15 checks passed
@NColey NColey deleted the explicit-openjdk-version branch January 12, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants