A developer creates a Dockerfile for a Python web application. Which instruction should be used to copy the application source code into the container image?
Trap 1: CMD
CMD provides defaults for executing container, not copying files.
Trap 2: RUN
RUN executes commands during build, not for copying files.
Trap 3: EXPOSE
EXPOSE documents ports, does not copy files.
- A
CMD
Why wrong: CMD provides defaults for executing container, not copying files.
- B
COPY
COPY is the correct instruction to copy files into the image.
- C
RUN
Why wrong: RUN executes commands during build, not for copying files.
- D
EXPOSE
Why wrong: EXPOSE documents ports, does not copy files.