Bird
0
0

Which Dockerfile instruction correctly copies the Spring Boot jar file into the container?

easy📝 Syntax Q3 of 15
Spring Boot - Docker and Deployment
Which Dockerfile instruction correctly copies the Spring Boot jar file into the container?
ACOPY target/myapp.jar /app/myapp.jar
BRUN target/myapp.jar /app/myapp.jar
CADD /app/myapp.jar target/myapp.jar
DMOVE target/myapp.jar /app/myapp.jar
Step-by-Step Solution
Solution:
  1. Step 1: Recall Dockerfile COPY usage

    COPY copies files from host to container filesystem.
  2. Step 2: Match correct syntax

    COPY target/myapp.jar /app/myapp.jar uses COPY with source then destination paths correctly.
  3. Final Answer:

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

    Dockerfile copy syntax = COPY source destination [OK]
Quick Trick: COPY copies files; RUN executes commands [OK]
Common Mistakes:
  • Using RUN to copy files
  • Confusing ADD and MOVE commands
  • Wrong order of source and destination

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes