C. Add a Docker task to the build pipeline, responsible for building the Docker image and pushing it to Azure Container Registry
Add the FROM instruction in the Dockerfile file: required instructions to build the desired Docker image.
Add a Copy and Publish Build Artifacts task to the build pipeline: copy and publish build output files or artifacts to a specific location within Azure DevOps.
Add the MAINTAINER instruction in the Dockerfile file: specifies the author or maintainer of the Docker image
C is the answer.
https://learn.microsoft.com/en-us/azure/devops/pipelines/ecosystems/containers/acr-template?view=azure-devops#how-we-build-your-pipeline
The build stage uses the Docker task Docker@2 to build and push your Docker image to the container registry.
https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/docker-v2?view=azure-pipelines&tabs=yaml#remarks
The following are the key benefits of using the Docker task instead of directly using Docker client binary in a script.
- Integration with Docker registry service connection - The task makes it easy to use a Docker registry service connection for connecting to any container registry. Once signed in, you can add follow up tasks that execute other tasks or scripts by leveraging the sign on used by the Docker task. For example, use the Docker task to sign in to any Azure Container Registry, and then use another task or script to build and push an image to the registry.
Now use Azure Container Registry to build and push an image. First, create a local working directory and then create a Dockerfile named Dockerfile with the single line: FROM mcr.microsoft.com/hello-world.
https://docs.microsoft.com/en-us/azure/container-registry/container-registry-quickstart-task-cli#build-and-push-image-from-a-dockerfile
You are building from Azure DevOps. First, you need to create a Docker task on the build stage. The others (Dockerfile creation, push to ACR) are later
upvoted 1 times
...
...
This section is not available anymore. Please use the main Exam Page.AZ-400 Exam Questions
Log in to ExamTopics
Sign in:
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.
d0bermannn
Highly Voted 3 years, 2 months agovsvaid
Most Recent 11 months, 2 weeks agoyana_b
1 year, 4 months agorenzoku
1 year, 5 months agozellck
1 year, 6 months agozellck
1 year, 6 months agozellck
1 year, 6 months agoIaminall
1 year, 10 months agosyu31svc
2 years, 4 months agoEltooth
2 years, 6 months agordemontis
2 years, 8 months agoSara_Mo
2 years, 10 months agojojom19980
3 years, 4 months agoLexa
3 years, 4 months agordemontis
2 years, 8 months agoxortan
3 years agoChauPhan
3 years ago