Skip to content

What docker compose up does

Select an icon to see what it is.

Step 4 of 6

One create call per container

Compose sends POST /containers/create for each service, named shop-<service>-<number>. It adds labels for the project, the service and the container number. It also attaches the container to shop-net with the service name as a network alias.

POST /v1.45/containers/create?name=shop-db-1

{
"Image": "postgres"
"Labels": {
"com.docker.compose.project": "shop"
"com.docker.compose.service": "db"
"com.docker.compose.container-number": "1"
}
"HostConfig": {
"NetworkMode": "shop-net"
}
"NetworkingConfig": {
"EndpointsConfig": {
"shop-net": {
"Aliases": [
"db"
]
"IPAMConfig": {
"IPv4Address": "172.18.0.4"
}
}
}
}
}