Using container jobs in Azure Pipelines
In this chapter, we saw that when you create a pipeline, you define jobs, and that when the pipeline is executed, these jobs runs on the host machine where the agent is installed.
If you're using Windows or Linux agents, you can also run a job inside a container (in an isolated way from the host). To run a job inside a container, you need to have Docker installed on the agent and your pipeline must have permission to access the Docker daemon. If you're using Microsoft-hosted agents, running jobs in containers is actually supported on the windows-2019
and ubuntu-16.04
pool images.
As an example, this is a YAML definition for using a container job in a Windows pipeline:
pool: vmImage: 'windows-2019' container: mcr.microsoft.com/windows/servercore:ltsc2019 steps: - script: date /t displayName: Gets the current date - script: dir workingDirectory: $(Agent.BuildiDirectory...