Skip to content

Commit 524191a

Browse files
committed
edits
1 parent b105be8 commit 524191a

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

docs/pipelines/process/service-containers.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,15 @@ monikerRange: azure-devops
1313

1414
[!INCLUDE [version-eq-azure-devops](../../includes/version-eq-azure-devops.md)]
1515

16-
This article describes using *service containers* in Azure Pipelines. A *container* provides a simple and portable way to run a service. Service containers let you automatically create, network, and manage the lifecycles of services that your pipelines depend on.
16+
This article describes using service containers in Azure Pipelines. If your pipeline requires the support of one or more services, you might need to create, connect to, and clean up the services per [job](phases.md). For example, your pipeline might run integration tests that require access to a newly created database and memory cache for each job in the pipeline.
1717

18-
If your pipeline requires the support of one or more services, you might need to create, connect to, and clean up the services per [job](phases.md). For example, your pipeline might run integration tests that require access to a newly created database and memory cache for each job in the pipeline.
18+
A *service container* provides a simple and portable way to run a service. A service container is accessible only to the job that requires it.
1919

20-
A service container is accessible only to the job that requires it. Service containers work with any kind of job, but are most commonly used with [container jobs](container-phases.md).
20+
Service containers let you automatically create, network, and manage the lifecycles of services that your pipelines depend on. Service containers work with any kind of job, but are most commonly used with [container jobs](container-phases.md).
2121

2222
>[!NOTE]
2323
>Classic pipelines don't support service containers.
2424
25-
2625
## Conditions and limitations
2726

2827
- Service containers must define a `CMD` or `ENTRYPOINT`. The pipeline runs `docker run` with no arguments for the provided container.
@@ -129,7 +128,7 @@ steps:
129128

130129
## Ports
131130

132-
Specifying `ports` isn't required if your job is running in a container, because containers on the same Docker network automatically expose all ports to each other by default. Jobs that run directly on the host require `ports` to access the service container.
131+
Jobs that run directly on the host require `ports` to access the service container. Specifying `ports` isn't required if your job is running in a container, because containers on the same Docker network automatically expose all ports to each other by default.
133132

134133
A port takes the form `<hostPort>:<containerPort>` or just `<containerPort>` with an optional `/<protocol>` at the end. For example, `6379/tcp` exposes `tcp` over port `6379`, bound to a random port on the host machine.
135134

@@ -170,11 +169,11 @@ services:
170169
```
171170

172171
>[!NOTE]
173-
>Microsoft-hosted pools don't persist volumes between jobs because the host machine is cleaned up after each job.
172+
>Microsoft-hosted pools don't persist volumes between jobs, because the host machine is cleaned up after each job.
174173

175174
## Multiple containers with services example
176175

177-
The following example has a Django Python web container connected to PostgreSQL and MySQL database containers.
176+
The following example pipeline has a Django Python web container connected to PostgreSQL and MySQL database containers.
178177

179178
- The PostgreSQL database is the primary database, and its container is named `db`.
180179
- The `db` container uses volume `/data/db:/var/lib/postgresql/data`, and passes three database variables to the container via `env`.

0 commit comments

Comments
 (0)