nerdexam
Microsoft

AZ-204 · Question #174

For an application Nea as developer needs to Create a Dockerfile. The application will be based on ASP.Net core. The application has the following requirements: - Ensure that the application whizlabsA

The correct answer is D. Only 3 and 4. The relevant Dockerfile commands to ensure an ASP.NET Core application runs at startup and a PowerShell script executes are ENTRYPOINT commands, with one specifically launching the .NET application and the other attempting to include the script.

Submitted by khalil_dz· Mar 30, 2026Develop Azure compute solutions

Question

For an application Nea as developer needs to Create a Dockerfile. The application will be based on ASP.Net core. The application has the following requirements: - Ensure that the application whizlabsApp.dll runs at the startup of the docker container - Run a powershell script called whizlabscsript.ps1 in the Docker container The tptApp.dll and the tptcsript.ps1 are in the same location as the DockerFile. Which of the following commands wouldNea place in the DockerFile? 1.) FROM Microsoft/dotnet:2.2-aspnetcore-runtime 2.) EXPOSE tptApp.dll ,tptcsript.ps1 3.) ENTRYPOINT ["dotnet", " MySingleContainerWebApp.dll 4.) ENTRYPOINT ["tptApp.dll" ,"tptcsript.ps1"]

Options

  • AOnly 2 and 3
  • BOnly 1, 3 and 4
  • COnly 1 and 2
  • DOnly 3 and 4

How the community answered

(17 responses)
  • A
    6% (1)
  • B
    6% (1)
  • C
    18% (3)
  • D
    71% (12)

Why each option

The relevant Dockerfile commands to ensure an ASP.NET Core application runs at startup and a PowerShell script executes are `ENTRYPOINT` commands, with one specifically launching the .NET application and the other attempting to include the script.

AOnly 2 and 3

Option 2 (`EXPOSE tptApp.dll ,tptcsript.ps1`) is incorrect as `EXPOSE` is used for specifying network ports, not for listing files or executing commands.

BOnly 1, 3 and 4

Option 2 is incorrect, therefore any choice including it, such as this one, is invalid.

COnly 1 and 2

Option 2 is incorrect, therefore any choice including it, such as this one, is invalid.

DOnly 3 and 4Correct

Line 3, `ENTRYPOINT ["dotnet", " MySingleContainerWebApp.dll"]`, is the standard and correct way to define the startup command for an .NET Core application within a Docker container. Line 4, `ENTRYPOINT ["tptApp.dll" ,"tptcsript.ps1"]`, attempts to define an entry point that includes both the application and the PowerShell script, aligning with the requirement to run the PowerShell script, although its specific functionality relies on `tptApp.dll` being a custom launcher or if `tptcsript.ps1` is passed as an argument to the application.

Concept tested: Dockerfile ENTRYPOINT and application startup

Source: https://docs.docker.com/engine/reference/builder/#entrypoint

Topics

#Dockerfile#ENTRYPOINT#ASP.NET Core#container runtime

Community Discussion

No community discussion yet for this question.

Full AZ-204 Practice