QuizzesDocker & Deployment — Concept Check
intermediate
spring-boot

Docker & Deployment — Concept Check

Questions on Docker & Deployment. A multi-stage Dockerfile builds a lean production image. Docker Compose orchestrates your Spring Boot app with its dependencies (PostgreSQL, Redis) for local development and testing.

8 minutes 8 questions Pass at 70%
Time Limit
8 minutes - timer starts when you begin
Change Answers Freely
Revisit and change any answer before submitting
Full Review After Submit
Correct answers and explanations shown for every question
Auto-submit on timeout
Quiz submits automatically when time runs out

Questions in this quiz

8 questions on Docker & Deployment — Concept Check. Work through them here, then start the quiz to answer them and see your score.

  1. 1.You are deploying a Spring Boot app using a multi-stage Dockerfile. The production image is unexpectedly large. What could be the issue?

    • AIncorrectly layering dependencies
    • BUsing JRE instead of JDK
    • CRunning the app as a non-root user
    • DIncluding JDK in the runtime image
  2. 2.During local development with Docker Compose, your Spring Boot app fails to connect to PostgreSQL. What might be the cause?

    • APostgreSQL service is not healthy yet
    • BIncorrect database credentials
    • CRedis service is not healthy yet
    • DSpring Boot app is not running
  3. 3.In a multi-stage Dockerfile, why is it important to copy dependencies first in the runtime stage?

    • ATo enable faster startup
    • BTo minimize rebuild time
    • CTo improve security
    • DTo reduce image size
  4. 4.You notice your Spring Boot app runs as root in the Docker container. Why is this a concern?

    • AIt poses a security risk
    • BIt slows down the app
    • CIt increases the image size
    • DIt requires more resources
  5. 5.What is the role of the `depends_on` condition in Docker Compose for your Spring Boot app?

    • AOptimizes CPU usage
    • BReduces memory usage
    • CImproves network performance
    • DEnsures services start in the correct order
  6. 6.A developer claims using JDK in the production image is better for performance. Why is this incorrect?

    • AJDK improves performance
    • BJDK is required for running Java apps
    • CJDK enhances security
    • DJDK increases image size without runtime benefits
  7. 7.While using Docker Compose, your app restarts frequently. What could be the reason?

    • AThe app is set to restart unless stopped
    • BThe app has a memory leak
    • CThe database connection is slow
    • DRedis is not configured properly
  8. 8.What is a key benefit of using multi-stage builds in Docker for a Spring Boot app?

    • AIncreases build speed
    • BEliminates the need for Docker Compose
    • CSimplifies Dockerfile syntax
    • DProduces smaller, optimized images