Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam AZ-303 topic 3 question 1 discussion

Actual exam question from Microsoft's AZ-303
Question #: 1
Topic #: 3
[All AZ-303 Questions]

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.
You have a server named Server1 that runs Windows Server 2019. Server1 is a container host.
You are creating a Dockerfile to build a container image.
You need to add a file named File1.txt from Server1 to a folder named C:\Folder1 in the container image.
Solution: You add the following line to the Dockerfile.
XCOPY File1.txt C:\Folder1\
You then build the container image.
Does this meet the goal?

  • A. Yes
  • B. No
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️
Copy is the correct command to copy a file to the container image. Furthermore, the root directory is specified as '/' and not as 'C:/'.
Reference:
https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#add-or-copy https://docs.docker.com/engine/reference/builder/

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
azurecert2021
Highly Voted 3 years, 3 months ago
following should be the justification for No XCOPY is not valid command and backslash is not allowed
upvoted 21 times
...
sandeepmalik
Most Recent 2 years ago
In today's exam. Score 900+ Correct answer.
upvoted 1 times
...
JDS11
2 years, 1 month ago
Selected Answer: B
COPY is the correct command
upvoted 1 times
...
monkalways
2 years, 6 months ago
Should be: COPY C:/Folder1/File1.txt File1.txt
upvoted 1 times
...
syu31svc
2 years, 7 months ago
There is no XCOPY command for a Dockerfile so answer is NO
upvoted 2 times
...
MinhajR
2 years, 7 months ago
On Exam 27/08/2021
upvoted 2 times
...
bhushan_786
2 years, 8 months ago
COPY and ADD are correct commands, so B is correct answer.
upvoted 2 times
...
mojsamspam
2 years, 9 months ago
docker cp File1.txt Server1:c:/Folder1/
upvoted 1 times
mojsamspam
2 years, 9 months ago
please ignore my previous comment. Command I issued does the opposite
upvoted 2 times
...
...
exampass999
2 years, 10 months ago
Correct: B o→ XCOPY File1.txt C:/Folder1/ x→ XCOPY File1.txt C:\Folder1\
upvoted 2 times
...
VivekSood
2 years, 11 months ago
Answer 'B' it is accomplished by Copy command
upvoted 1 times
...
Kraviecc
3 years, 3 months ago
Correct
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...