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-203 topic 1 question 7 discussion

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

DRAG DROP -
You plan to create a Docker image that runs as ASP.NET Core application named ContosoApp. You have a setup script named setupScript.ps1 and a series of application files including ContosoApp.dll.
You need to create a Dockerfile document that meets the following requirements:
✑ Call setupScript.ps1 when the container is built.
✑ Run ContosoApp.dll when the container starts.
The Docker document must be created in the same folder where ContosoApp.dll and setupScript.ps1 are stored.
Which four commands should you use to develop the solution? To answer, move the appropriate commands from the list of commands to the answer area and arrange them in the correct order.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer: Explanation
Step 1: WORKDIR /apps/ContosoApp
Step 2: COPY ./-
The Docker document must be created in the same folder where ContosoApp.dll and setupScript.ps1 are stored.
Step 3: EXPOSE ./ContosApp/ /app/ContosoApp
Step 4: CMD powershell ./setupScript.ps1
ENTRYPOINT ["dotnet", "ContosoApp.dll"]
You need to create a Dockerfile document that meets the following requirements:
✑ Call setupScript.ps1 when the container is built.
✑ Run ContosoApp.dll when the container starts.
References:
https://docs.microsoft.com/en-us/azure/app-service/containers/tutorial-custom-docker-image

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
sho1
Highly Voted 4 years, 2 months ago
FROM WORKDIR COPY RUN CMD
upvoted 41 times
riley5
4 years ago
Why not CMD + ENTRYPOINT?
upvoted 2 times
BakePVL
3 years, 10 months ago
CMD doesn't run powershell command when container is built. It only runs command when container starts. https://goinbigdata.com/docker-run-vs-cmd-vs-entrypoint/
upvoted 2 times
...
zenth0r
3 years, 10 months ago
CMD and ENTRYPOINT differ only slightly, and are run in the runtime. The requirement is to run the powershell script during build, hence RUN.
upvoted 1 times
...
...
riley5
4 years ago
Run + cmd executes build time instructions, but doesn't run in the container
upvoted 2 times
...
tejasmehta8819
3 years, 3 months ago
As per question, 4 commands to be used not 5
upvoted 2 times
...
cbn
3 years, 2 months ago
Agree. A good reading on selecting the last option: https://goinbigdata.com/docker-run-vs-cmd-vs-entrypoint/
upvoted 1 times
...
...
gssicftohbcrcsgtjg
Highly Voted 4 years, 2 months ago
Options https://www.examtopics.com/assets/media/exam-media/02758/0036700001.jpg
upvoted 27 times
...
jhonattansolarte
Most Recent 2 years, 9 months ago
**** RESPONSE: https://user-images.githubusercontent.com/8276103/125328006-6abe4f80-e309-11eb-8f4d-ff78414aff3a.jpeg
upvoted 1 times
...
simonverma
3 years ago
STEP 1: FROM STEP 2: WORKDIR STEP 3: COPY STEP 4: RUN POWERSHELL CMD Image Url: https://www.examtopics.com/discussions/microsoft/view/13131-exam-az-300-topic-3-question-4-discussion/
upvoted 1 times
...
bhushan_786
3 years, 5 months ago
The answer provided by examtopics is totally different than the discussions here, can someone provide correct answer please?
upvoted 1 times
leshuva
3 years, 4 months ago
FROM base_image WORKDIR tocreatedirectoryinthecontainer COPY thecontentfromexistingcodedirectorytocontainerimage CMD
upvoted 2 times
...
...
mszydel
3 years, 7 months ago
There are four commands to choose, most of you suggest 5 commands ...
upvoted 3 times
...
Subhijith
3 years, 8 months ago
FROM base_image WORKDIR tocreatedirectoryinthecontainer COPY thecontentfromexistingcodedirectorytocontainerimage CMD ENTRYPOINT
upvoted 4 times
...
hertino
3 years, 8 months ago
Today I got 900, I had this question, my answer: WORKDIR /apps/ContosoApp COPY ./- EXPOSE ./ContosApp/ /app/ContosoApp CMD powershell ./setupScript.ps1 ENTRY
upvoted 2 times
SilNilanjan
3 years, 8 months ago
Don't think so... there is no base-image, plus the EXPOST command should have this syntax: EXPOSE <port> [<port>/<protocol>...] but it is incorrect here
upvoted 1 times
...
bhushan_786
3 years, 3 months ago
This could be one of your wrong answer :-)
upvoted 3 times
...
...
Steve_az
3 years, 8 months ago
https://www.examtopics.com/discussions/microsoft/view/13131-exam-az-300-topic-3-question-4-discussion/
upvoted 2 times
...
brajen
3 years, 9 months ago
The last command will be used to run the application when the container starts up. We have to use the ENTRYPOINT command for this. So the correct answer is- FROM > WORKDIR > COPY > CMD/ENTRYPOINT
upvoted 1 times
...
Not_Sure_Who_Am_I
3 years, 10 months ago
Options: https://vceguide.com/wp-content/uploads/2019/10/Microsoft-AZ-300-date-01-06-2019-00001_Page_304_Image_0001.jpg
upvoted 4 times
...
AK89
3 years, 11 months ago
The correct answer is : FROM - this is always starting point of a Dokerfile WORKDIR COPY CMD ENTRYPOINT
upvoted 3 times
...
lau13
3 years, 11 months ago
This can NOT be the Entrypoint, because the question stated that it must run the setupScript.ps1 when container is built, to do that, it must be the option with RUN CMD and Entrypoint are similar, they both execute when container starts. The only difference is CMD will be ignored if you execute the container with a command specified; however Entrypoint won't be ignored.
upvoted 3 times
...
Iloves73g
3 years, 11 months ago
FROM WORKDIR COPY RUN CMD STEP 1: FROM microsoft/ aspnetcore:2.0 STEP 2: WORKDIR /apps/ContosoAPP STEP 3: COPY . . STEP 4: RUN powershell setupScript.ps1 CMD ["dotnet", " ContosoApp.dll"]
upvoted 22 times
...
shuakwe
3 years, 11 months ago
It's asking for four Docker commands, not to choose four options. "The Docker document must be created in the same folder where ContosoApp.dll and setupScript.ps1 are stored" -> This means WORKDIR is not needed. Solution: FROM COPY RUN CMD
upvoted 1 times
...
Mvii
3 years, 11 months ago
CMD and ENTRYPOINT can't be used together as they do the same thing. FROM WORKDIR COPY RUN CMD
upvoted 3 times
...
riley5
4 years ago
Correct? FROM WORKDIR COPY RUN CMD
upvoted 4 times
riley5
4 years ago
correction: FROM > WORKDIR > COPY > CMD/ENTRYPOINT
upvoted 8 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 ...