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.
Question
Options
- AOnly 2 and 3
- BOnly 1, 3 and 4
- COnly 1 and 2
- DOnly 3 and 4
How the community answered
(17 responses)- A6% (1)
- B6% (1)
- C18% (3)
- D71% (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.
Option 2 (`EXPOSE tptApp.dll ,tptcsript.ps1`) is incorrect as `EXPOSE` is used for specifying network ports, not for listing files or executing commands.
Option 2 is incorrect, therefore any choice including it, such as this one, is invalid.
Option 2 is incorrect, therefore any choice including it, such as this one, is invalid.
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
Community Discussion
No community discussion yet for this question.