Installation, Storage, and Compute with Windows Server 2016 — Question 209
You have a server named Server1 that runs Windows Server 2016.
Server1 is a Docker host.
You are creating a Dockerfile to build a Docker image.
You need to add a file named File1.txt from Server1 to C:\Folder1\ in the Docker image.
What are two possible commands that you can use to achieve the goal? Each correct answer presents a complete solution.
NOTE: Each correct selection is worth one point.
Answer options
- A. COPY file1.txt c:/folder1/
- B. copy-item file1.txt folder1\file1.txt
- C. ROBOCOPY file.txt \folder1\
- D. XCOPY file1.txt c:\folder1\
- E. ADD file1.txt /folder1/
Correct answer: A, E
Explanation
The correct answers are A and E because both the COPY and ADD commands are used in Docker to transfer files into the image during the build process. Options B, C, and D are incorrect as they are not valid Docker commands for adding files to the image.