Bird
0
0

Which of the following is the correct syntax to copy the Spring Boot jar file into the Docker image in a Dockerfile?

easy📝 Configuration Q12 of 15
Spring Boot - Docker and Deployment
Which of the following is the correct syntax to copy the Spring Boot jar file into the Docker image in a Dockerfile?
ACOPY /app.jar target/app.jar
BMOVE target/app.jar /app.jar
CADD target/app.jar
DCOPY target/app.jar /app.jar
Step-by-Step Solution
Solution:
  1. Step 1: Understand COPY command syntax

    The COPY command syntax is: COPY source_path destination_path inside the image.
  2. Step 2: Apply to Spring Boot jar

    We copy the built jar from local 'target/app.jar' to '/app.jar' inside the image.
  3. Final Answer:

    COPY target/app.jar /app.jar -> Option D
  4. Quick Check:

    COPY source destination [OK]
Quick Trick: COPY source then destination path [OK]
Common Mistakes:
  • Using MOVE instead of COPY
  • Missing destination path in ADD
  • Reversing source and destination paths

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes