Skip to content

Update Java base images - #321

Merged
alexellis merged 2 commits into
openfaas:masterfrom
welteki:update-java-base-images
Sep 29, 2026
Merged

alexellis merged 2 commits into
openfaas:masterfrom
welteki:update-java-base-images

Conversation

@welteki

@welteki welteki commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Description

Update the java11, java11-vert-x, and java17 templates from the removed OpenJDK 11 and 17 Docker Hub tags to eclipse-temurin:*-noble, following maintainer feedback. The runtime stages continue to use JRE images rather than JDK images.

Add RUN chown -R app /home/app to the java11 and java17 templates so the non-root app user can extract the function distribution on Noble.

Correct outdated Java and Gradle versions, handler paths, and dependency information in the three template READMEs.

Replace the deprecated JCenter repository with Maven Central throughout the Java templates.

Motivation and Context

  • I have raised an issue to propose this change (required)

The OpenJDK 11 and 17 tags used by the Java templates have been removed from Docker Hub, causing builds to fail while resolving the base images. This change migrates the templates to the maintained Eclipse Temurin images discussed in #319.

Which issue(s) this PR fixes

Fixes #319

How Has This Been Tested?

Built and ran a test function for each template with faas-cli local-run --build.

The java11 and java17 functions returned HTTP 200 with Hello, world!. The java11-vert-x function returned HTTP 200 with {"status":"ok"}.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Version change (see: Impact to existing users)

Impact to existing users

Functions rebuilt from these Java templates will use Eclipse Temurin on Ubuntu Noble instead of the removed OpenJDK images. The runtime stages remain JRE-based, and existing deployed images are unaffected.

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@reviewfn

This comment has been minimized.

@welteki
welteki force-pushed the update-java-base-images branch from 2be04f8 to e8f5fc3 Compare September 25, 2026 14:31
@reviewfn

This comment has been minimized.

Signed-off-by: Han Verstraete (OpenFaaS Ltd) <han@openfaas.com>
@welteki
welteki force-pushed the update-java-base-images branch from e8f5fc3 to 8d83f73 Compare September 25, 2026 14:38
@reviewfn

This comment has been minimized.

JCenter is deprecated and read-only. Use Maven Central for dependency
resolution in the Java 11, Java 11 Vert.x, and Java 17 templates.

Signed-off-by: Han Verstraete (OpenFaaS Ltd) <han@openfaas.com>
@reviewfn

reviewfn Bot commented Sep 28, 2026

Copy link
Copy Markdown

AI Pull Request Overview

Disclaimer: This review was generated by automated AI and may contain errors. Do not trust its outputs without human verification.

Summary

  • Updates the Java 11, Java 11 Vert.x, and Java 17 Docker build/runtime images from removed OpenJDK tags to Eclipse Temurin Noble tags.
  • Keeps runtime images JRE-based for the standard Java 11 and Java 17 templates.
  • Adds ownership adjustment in the Java 11 and Java 17 runtime stages before extracting the function distribution as the non-root app user.
  • Replaces JCenter repository usage with Maven Central in the changed Gradle files.
  • Corrects README Gradle versions, Java template names, handler paths, and dependency repository wording.
  • The scoped changes are small and aligned with the PR's stated migration from removed base image tags.

Approval rating (1-10)

9/10. The changes are focused and low risk; no blocking correctness, runtime, or documentation issues were identified in the scoped diff.

Summary per file

Summary per file
File path Summary
template/java11-vert-x/Dockerfile Switches builder and runtime images to Eclipse Temurin 11 Noble.
template/java11-vert-x/README.md Updates Gradle version and dependency repository wording.
template/java11-vert-x/build.gradle Replaces JCenter with Maven Central for all projects.
template/java11-vert-x/entrypoint/build.gradle Replaces JCenter with Maven Central in entrypoint repository config.
template/java11-vert-x/function/build.gradle Replaces JCenter with Maven Central in function repository config.
template/java11/Dockerfile Switches Java 11 images and fixes runtime ownership before unzip.
template/java11/README.md Updates Gradle version, handler path, and repository wording.
template/java11/build.gradle Replaces JCenter with Maven Central in root repository config.
template/java11/function/build.gradle Replaces JCenter with Maven Central in function repository config.
template/java17/Dockerfile Switches Java 17 images and fixes runtime ownership before unzip.
template/java17/README.md Corrects template identity, Gradle version, handler path, and repository wording.
template/java17/build.gradle Replaces JCenter with Maven Central in root repository config.

Overall Assessment

The PR addresses the removed Docker Hub OpenJDK image tags with a narrow migration to maintained Eclipse Temurin Noble images, while preserving the intended JRE runtime stages. The added chown steps are placed before dropping to the non-root user and before archive extraction, which directly addresses the ownership-sensitive path in the runtime stages. The Gradle repository updates and README corrections are consistent with the Dockerfile versions and visible template contents. I did not find a concrete blocking defect in the scoped changes.

Detailed Review

Detailed Review

No blocking findings.

The image changes in template/java11/Dockerfile, template/java11-vert-x/Dockerfile, and template/java17/Dockerfile are constrained to the builder/runtime bases and do not alter the watchdog setup or fprocess commands. The Java 11 and Java 17 runtime ownership changes are applied after copying the distribution ZIP and before switching to the app user, so the subsequent unzip runs with write access to /home/app.

The repository changes from jcenter() to mavenCentral() are applied consistently across the changed root, function, and entrypoint Gradle files. The dependency declarations visible in the changed Vert.x template use Maven Central coordinates, and the standard Java templates retain their existing OpenFaaS helper coordinates while changing only the repository source.

The README updates match the changed Dockerfile Gradle versions and correct previously stale template and handler-path text. The changed documentation does not introduce a rendering issue in the inspected Markdown.

AI agent details.

Agent processing time: 1m45.909s
Environment preparation time: 3.456s
Total time from webhook: 1m52.247s

@alexellis
alexellis merged commit 8d08732 into openfaas:master Sep 29, 2026
2 checks passed
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.

Java templates fail to build: openjdk base image tags removed from Docker Hub

2 participants