Bird
0
0

What is the best base image to use in a Dockerfile for a Spring Boot application running on Java 17?

easy📝 Conceptual Q1 of 15
Spring Boot - Docker and Deployment
What is the best base image to use in a Dockerfile for a Spring Boot application running on Java 17?
Aopenjdk:17-jdk-slim
Bnode:latest
Cpython:3.12
Dubuntu:20.04
Step-by-Step Solution
Solution:
  1. Step 1: Identify the Java version requirement

    Spring Boot applications require a Java runtime. Java 17 is a current LTS version suitable for production.
  2. Step 2: Choose a base image with Java 17

    The image openjdk:17-jdk-slim provides a lightweight Java 17 environment ideal for Spring Boot apps.
  3. Final Answer:

    openjdk:17-jdk-slim -> Option A
  4. Quick Check:

    Base image for Java 17 = openjdk:17-jdk-slim [OK]
Quick Trick: Use openjdk images matching your Java version [OK]
Common Mistakes:
  • Choosing unrelated base images like node or python
  • Using full Ubuntu without Java installed

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes