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 2 discussion

Actual exam question from Microsoft's AZ-303
Question #: 2
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.
ADD 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. The ADD command can also be used. However, 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
Bbg1
Highly Voted 3 years, 3 months ago
Yes, Considerations for running ADD with Windows On Windows, the destination format must use forward slashes. For example, these are valid ADD instructions: Dockerfile ADD test1.txt /temp/ ADD test1.txt c:/temp/
upvoted 51 times
TheAzureArchitect
2 years, 5 months ago
https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/manage-windows-dockerfile#examples-of-using-add-with-windows
upvoted 2 times
...
...
azurecert2021
Highly Voted 3 years, 3 months ago
answer should be yes as following are the correct format according to below URL COPY test1.txt /temp/ COPY test1.txt c:/temp/ COPY source /sqlite/ COPY config* c:/temp/ ADD test1.txt /temp/ ADD test1.txt c:/temp/ ADD source /sqlite/ ADD config* c:/temp/ https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/manage-windows-dockerfile
upvoted 31 times
StarkStrange
3 years, 2 months ago
Yep agreed, the URL clearly mentions all options. COPY and ADD both. the ans should be yes.
upvoted 1 times
...
...
sandeepmalik
Most Recent 2 years ago
In today's exam. Score 900+ Correct answer...A ADD or COPY both are ok..
upvoted 1 times
...
arun
2 years, 1 month ago
Selected Answer: A
Should be Yes... ADD test1.txt /temp/ ADD test1.txt c:/temp/ are valid as per https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/manage-windows-dockerfile#considerations-for-running-add-with-windows
upvoted 1 times
...
justfordevelopment
2 years, 1 month ago
Selected Answer: A
valid ADD instructions: Dockerfile ADD test1.txt /temp/ ADD test1.txt c:/temp/
upvoted 1 times
...
Noexperience
2 years, 4 months ago
Answer is Yes https://phoenixnap.com/kb/docker-add-vs-copy
upvoted 3 times
...
syu31svc
2 years, 7 months ago
Answer is Yes for sure On Windows, the destination format must use forward slashes. For example, these are valid ADD instructions: ADD test1.txt /temp/ ADD test1.txt c:/temp/ https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/manage-windows-dockerfile
upvoted 3 times
...
hamzeh69
2 years, 9 months ago
Pass exam, come today in my exam 6/7/2021
upvoted 1 times
...
LT
3 years ago
Answer is NO, due to syntax error. ADD/Copy are valid command
upvoted 1 times
...
DBoss
3 years, 1 month ago
Yes is correct answer https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/manage-windows-dockerfile
upvoted 3 times
...
luckyfriend
3 years, 2 months ago
Considerations for running ADD with Windows On Windows, the destination format must use forward slashes. For example, these are valid ADD instructions: Dockerfile Copy ADD test1.txt /temp/ ADD test1.txt c:/temp/ Meanwhile, the following format with backslashes won't work: Dockerfile Copy ADD test1.txt c:\temp\
upvoted 2 times
...
mactone
3 years, 3 months ago
check this URL https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/manage-windows-dockerfile The answer is YES
upvoted 2 times
...
YogeshSoni
3 years, 3 months ago
Answer is "Yes". On Windows, the destination format must use forward slashes: ADD filename.txt /temp/ ADD filename.txt c:/temp/ Add . /temp/ Add . c:/temp/ Whereas, the following format with backslashes won't work: ADD filename.txt c:\temp\
upvoted 3 times
...
widurr
3 years, 3 months ago
answer is yes. Both are valid: COPY test1.txt /temp/ COPY test1.txt c:/temp/ https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/manage-windows-dockerfile
upvoted 2 times
...
uthayan01
3 years, 3 months ago
answer is correct, proper syntax would be C:\Folder1
upvoted 1 times
thebarber87
2 years, 3 months ago
False backslashes won't work. On Windows, the destination format must use forward slashes. For example, these are valid ADD instructions: Dockerfile Copy ADD test1.txt /temp/ ADD test1.txt c:/temp/ Meanwhile, the following format with backslashes won't work: Dockerfile Copy ADD test1.txt c:\temp\ https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/manage-windows-dockerfile#considerations-for-running-add-with-windows
upvoted 1 times
...
...
pagp
3 years, 3 months ago
ADD File1.txt C:/Folder1/ However, the root directory is specified as '/' and not as'C:/'. Above comment about is not clear - command mention c:/Folder... where does "/" only is referred. Anyone can clarify
upvoted 1 times
hw121693
2 years, 9 months ago
I guess they want to say "ADD File1.txt /Folder1/"
upvoted 1 times
...
...
Deepbond
3 years, 3 months ago
Yes is correct answer
upvoted 1 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 ...