exam questions

Exam AZ-204 All Questions

View all questions & answers for the AZ-204 exam

Exam AZ-204 topic 2 question 21 discussion

Actual exam question from Microsoft's AZ-204
Question #: 21
Topic #: 2
[All AZ-204 Questions]

DRAG DROP -
You plan to create a Docker image that runs an 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 setupScripts.ps1 when the container is built.
✑ Run ContosoApp.dll when the container starts.
The Dockerfile document must be created in the same folder where ContosoApp.dll and setupScript.ps1 are stored.
Which five 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:

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
agueda
Highly Voted 4 years, 2 months ago
It should be: - FROM - WORKDIR - COPY - RUN - CMD Same question on: https://www.examtopics.com/discussions/microsoft/view/13131-exam-az-300-topic-3-question-4-discussion/ And: https://www.examtopics.com/discussions/microsoft/view/11045-exam-az-203-topic-1-question-7-discussion/
upvoted 303 times
PereCastor37
5 months, 3 weeks ago
Agree with you : Dockerfile example by chatgpt 4o without give him the sentence : FROM WORKDIR COPY RUN CMD
upvoted 1 times
...
Den1354
3 years, 4 months ago
- FROM - COPY - WORKDIR - RUN - CMD Otherwise we are going to set for work directory path which doesn't exist yet
upvoted 5 times
zolani
1 year, 1 month ago
True FROM microsoft/aspnetcore:latest This command specifies the base image for your container. WORKDIR /apps/ContosoApp This command sets the working directory for the container. COPY ./ . This command copies all files and folders from the current directory (where the Dockerfile resides) to the working directory (/apps/ContosoApp) inside the container. RUN powershell ./setupScript.ps1 This command runs the setupScript.ps1 script using PowerShell within the container during the build process. CMD ["dotnet", "ContosoApp.dll"] This command defines the default command that will be executed when the container starts.
upvoted 4 times
...
...
Dinima
4 years, 2 months ago
You are correct. This has been discussed in Udemy course as well as follows, The first statement in the Dockefile must be the FROM statement to specify the image to use as the base image. Then specify the Image working directory Then copy all of the application contents using the COPY command And then use the CMD command to run the PowerShell command and the ENTRYPOINT statement to run the dotnet application.
upvoted 29 times
Basu525
4 years, 2 months ago
as per Udemy, the last steps would be CMD powershell ./script.ps1 and then ENTRYPOINT (dotnet, xx.dll) which I believe is the correct answer. But unfortunately the options are not there in Examtopic
upvoted 3 times
ranjitklive
3 years, 10 months ago
ENTRYPOINT instruction works very similarly to CMD in that it is used to specify the command executed when the container is started.
upvoted 3 times
...
solidrock
3 years, 7 months ago
which udemy course you guys are talking about?
upvoted 2 times
...
...
...
balis
3 years, 2 months ago
This is correct answer It should be: - FROM - WORKDIR - COPY - RUN - CMD because WORKDIR will create directory if it doesn't exist https://docs.docker.com/engine/reference/builder/#workdir
upvoted 14 times
...
...
TakumaK
Highly Voted 3 years, 12 months ago
Just wondering who put the answers for the questions in this site? most of them are not correct.
upvoted 25 times
SlavMar
3 years, 11 months ago
VCE exams have same issues Probably this are some braindumps of people who were not well prepared to take test or they too test just to scrap exam questions but they have no matter knowledge
upvoted 4 times
...
...
heptadecane
Most Recent 7 months ago
FROM mcr.microsoft.com/dotnet/aspnet:latest WORKDIR /apps/ContosoApp COPY ./ . RUN powershell ./setupScript.ps1 CMD ["dotnet", "ContosoApp.dll"]
upvoted 3 times
...
4bd3116
9 months, 3 weeks ago
FROM microsoft/aspnetcore:latest COPY . /apps/ContosoApp WORKDIR /apps/ContosoApp RUN powershell ./setupScript.ps1 CMD ["dotnet", "ContosoApp.dll"]
upvoted 1 times
...
ciamp
9 months, 4 weeks ago
FROM ubuntu:latest WORKDIR /app COPY . /app RUN apt-get update && apt-get install -y <dependencies> CMD ["executable", "param1", "param2"]
upvoted 1 times
...
onlyforheros
1 year, 2 months ago
Got it in the exam 13.03.2024. Score: 910. Went with - FROM - WORKDIR - COPY - RUN - CMD
upvoted 3 times
...
AhmedAbdelAziz
1 year, 4 months ago
Answer is -FROM -RUN -WORKDIR - COPY - CMD check this link https://learn.microsoft.com/en-us/training/modules/intro-to-docker-containers/3-how-docker-images-work
upvoted 3 times
...
manopeydakon
1 year, 5 months ago
Here are the five commands you can use in the Dockerfile: FROM: Specify the base image. Dockerfile Copy code FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 COPY: Copy the application files to the container. Dockerfile Copy code COPY . /app WORKDIR: Set the working directory to the application folder. Dockerfile Copy code WORKDIR /app RUN: Execute the setup script during the image build process. Dockerfile Copy code RUN ./setupScript.ps1 CMD: Specify the command to run when the container starts. Dockerfile Copy code CMD ["dotnet", "ContosoApp.dll"] Make sure to adjust the paths and filenames according to your actual file structure.
upvoted 2 times
...
arunkuml
1 year, 5 months ago
Got it in the exam 14/12/23. All questions are from ExamTopics. Case study - VanArsdel, Ltd (11 questions)
upvoted 1 times
...
p2006
1 year, 8 months ago
Got on 9/25/2023 From Workdir Copy Run powershell Cmd ContosoApp.dll
upvoted 3 times
...
RuffBoii
1 year, 8 months ago
Had this on my exam today.
upvoted 1 times
...
mihailos
1 year, 9 months ago
Got it in exam 28/08/23. Scored 912. Went with the following: - FROM - WORKDIR - COPY - RUN - CMD
upvoted 1 times
TechyNetty
1 year, 9 months ago
Im yet to appear for exam soon. Since you attempted recently, were most of the questions from this site? Please respond, it will be helpful. thanks
upvoted 1 times
...
...
longnguyendh
1 year, 10 months ago
■ FROM … ■ WORKDIR … ■ COPY … ■ RUN … ■ CMD …
upvoted 1 times
...
deathRac3
2 years ago
Question was there for me on 29th May 2023
upvoted 1 times
...
70PineApple
2 years, 3 months ago
Got this in exam today..20/02/23 score: 817
upvoted 1 times
...
Priya0703
2 years, 3 months ago
Got this question today on 20-02-2023 exam.
upvoted 1 times
...
HafizSalmanMalik
2 years, 4 months ago
It should be: - FROM - WORKDIR - COPY - RUN - CMD
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 ...