You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/pipelines/process/container-phases.md
+9-13Lines changed: 9 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: YAML pipeline container jobs
3
3
description: Learn about configuring and running Azure Pipelines YAML pipeline jobs inside containers.
4
4
ms.assetid: 8d35f78a-f386-4699-9280-7bd933de9e7b
5
5
ms.topic: conceptual
6
-
ms.date: 08/18/2025
6
+
ms.date: 08/19/2025
7
7
monikerRange: "<=azure-devops"
8
8
#customer intent: As an Azure Pipelines builder and tester, I want to learn about running pipeline jobs in containers so I can build and test pipelines in various agent configurations.
This article explains container jobs in Azure Pipelines. Containers are lightweight abstractions from the host operating system that provide all the necessary elements to run a job in a specific environment.
16
16
17
-
By default, Azure Pipelines [jobs](phases.md) run directly on [agents](../agents/agents.md) installed on host machines. Hosted agent jobs are convenient, require little initial setup or infrastructure maintenance, and are well-suited for basic projects. If you want more control over task context, you can define and run pipeline jobs in containers that have the exact versions of operating systems, tools, and dependencies you want.
17
+
By default, Azure Pipelines [jobs](phases.md) run directly on [agents](../agents/agents.md) installed on host machines. Hosted agent jobs are convenient, require little initial setup or infrastructure maintenance, and are well-suited for basic projects. For more control over task context, you can define and run pipeline jobs in containers to get the exact versions of operating systems, tools, and dependencies you want.
18
18
19
-
For a container job, the agent first fetches and starts the container, and then runs each step of the job inside the container. If you need fine-grained control of individual build steps, you can use [step targets](tasks.md#step-target) to choose a container or host for each step.
19
+
For a container job, the agent first fetches and starts the container, and then runs each step of the job inside the container. If you need finer-grained control of individual build steps, you can use [step targets](tasks.md#step-target) to choose a container or host for each step.
20
20
21
21
## Requirements for container jobs
22
22
23
23
- A YAML-based pipeline. Classic pipelines don't support container jobs.
24
24
- A Windows or Ubuntu hosted agent. MacOS agents don't support containers. To use non-Ubuntu Linux agents, see [Nonglibc-based containers](#nonglibc-based-containers).
25
25
- Docker installed on the agent, with permission to access the Docker daemon.
26
-
27
-
>[!NOTE]
28
-
>Containers aren't supported when the agent is already running inside a container. You can't have nested containers.
26
+
- Agent running directly on the host, not already inside a container. Nested containers aren't supported.
29
27
30
28
### [Linux](#tab/linux)
31
29
@@ -36,9 +34,10 @@ Linux-based containers also have the following requirements:
36
34
- No `ENTRYPOINT`. Containers with an `ENTRYPOINT` might not work, because [docker exec](https://docs.docker.com/reference/cli/docker/container/exec) expects the container to always be running.
37
35
-`USER` provided with access to `groupadd` and other privileged commands without using `sudo`.
38
36
- Ability to run Node.js, which the agent provides.
37
+
>[!NOTE]
38
+
>Node.js must be preinstalled for Linux containers on Windows hosts.
39
39
40
-
>[!NOTE]
41
-
>Some stripped-down containers available on Docker Hub, especially containers based on Alpine Linux, don't satisfy these requirements. For more information, see [Nonglibc-based containers](#nonglibc-based-containers).
40
+
Some stripped-down containers available on Docker Hub, especially containers based on Alpine Linux, don't satisfy these requirements. For more information, see [Nonglibc-based containers](#nonglibc-based-containers).
42
41
43
42
### [Windows](#tab/windows)
44
43
@@ -52,9 +51,6 @@ Linux-based containers also have the following requirements:
52
51
53
52
---
54
53
55
-
>[!NOTE]
56
-
>Node.js must be preinstalled for Linux containers on Windows hosts.
57
-
58
54
## Single job
59
55
60
56
The following example defines a Windows or Linux single-job container.
@@ -144,7 +140,7 @@ For more information, see the [docker container create](https://docs.docker.com/
144
140
145
141
## Reusable container definition
146
142
147
-
The following example defines the containers in the `resources` section, and then references them by their assigned aliases. The `jobs` keyword is used for clarity.
143
+
The following YAML example defines the containers in the `resources` section, and then references them by their assigned aliases. The `jobs` keyword is used for clarity.
148
144
149
145
```yaml
150
146
resources:
@@ -199,7 +195,7 @@ container:
199
195
```
200
196
201
197
>[!NOTE]
202
-
>Azure Pipelines can't set up a service connection for Amazon Elastic Container Registry (ECR), because Amazon ECR requires other client tools to convert Amazon Web Services (AWS) credentials to use for Docker authentication.
198
+
>Azure Pipelines can't set up a service connection for Amazon Elastic Container Registry (ECR), because Amazon ECR requires other client tools to convert Amazon Web Services (AWS) credentials to be usable for Docker authentication.
0 commit comments