-
Notifications
You must be signed in to change notification settings - Fork 63
Fix Dockerfile: update OpenJDK base image to a valid tag #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: project
Are you sure you want to change the base?
Changes from all commits
ee961b6
2bceef5
a6044d4
371deaf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,8 +3,9 @@ | |
| #---------------------------------- | ||
|
|
||
| # Import docker image with maven installed | ||
| FROM maven:3.8.3-openjdk-17 as builder | ||
|
|
||
| # FROM maven:3.8.3-openjdk-17 as builder | ||
| # Import docker image with Maven and JDK 17 (from Eclipse Temurin) | ||
| FROM maven:3.8.3-eclipse-temurin-17 as builder | ||
| # Set working directory | ||
| WORKDIR /app | ||
|
|
||
|
|
@@ -19,7 +20,10 @@ RUN mvn clean install -DskipTests=true | |
| #-------------------------------------- | ||
|
|
||
| # Import small size java image | ||
| FROM openjdk:17-alpine as deployer | ||
| # FROM openjdk:17-alpine as deployer | ||
| # Use eclipse-temurin:17-jdk-alpine for runtime | ||
| FROM eclipse-temurin:17-jdk-alpine as deployer | ||
|
Comment on lines
+23
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: Summary — eclipse-temurin:17-jdk-alpine
References 🌐 Web query:
💡 Result: Short answer: eclipse-temurin:17-(jdk|jre)-alpine images have shown multiple security alerts tied to vulnerable Alpine packages and a few Java CVEs; fixes usually require rebuilding the Alpine-based image (to pick up updated Alpine/OpenJDK packages) or switching to a non‑Alpine Temurin image. Sources and examples below. Evidence / notes
Recommendations
Sources
(If you want, I can check the current Temurin 17 Alpine image build date and list exact CVE IDs affecting the exact image digest you use.) 🌐 Web query:
💡 Result: Short answer: The official openjdk Docker image (including many alpine tags) is deprecated/removed. The Docker Official Image maintainers deprecated the openjdk repo and many Alpine-based OpenJDK tags were discontinued because upstream OpenJDK builds are glibc‑based (Alpine uses musl), causing compatibility and build/support issues. Migrate to a maintained distribution (examples: eclipse‑temurin, amazoncorretto, ibm‑semeru, liberica/zulu where available) or use glibc‑based slim Debian images. [1][2][3] Actionable links:
References: Reconsider the Eclipse Temurin Alpine variant due to known vulnerabilities. While moving from the deprecated Additionally, Alpine uses musl instead of glibc — some Java native libraries or JVM features may be incompatible or require workarounds. Recommended mitigations:
🤖 Prompt for AI Agents |
||
|
|
||
|
|
||
| # Copy build from stage 1 (builder) | ||
| COPY --from=builder /app/target/*.jar /app/target/bankapp.jar | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider upgrading to a newer Maven version instead of 3.8.3.
The
maven:3.8.3-eclipse-temurin-17tag appears to exist on Docker Hub, but it is not part of the actively maintained tags. Current supported Maven images use 3.9.11 or later versions with Eclipse Temurin. Since the PR objective is to fix unavailable base images, upgrading tomaven:3.9.11-eclipse-temurin-17ormaven:3.8.9-eclipse-temurin-17would be preferable for receiving security updates and ongoing support.The
eclipse-temurin:17-jdk-alpineimage tag is actively available and appropriate for the deployer stage.🤖 Prompt for AI Agents