Docker Compose

docker compose stop

Stop existing service containers without removing them. Specify a bounded shutdown timeout; the writable layer remains but application process state does not. Record container identity before and after a subsequent start.

Formal Syntax & Structure

docker syntaxdocker
docker compose stop [OPTIONS] [SERVICE...]

Parameters & Attributes

NameTypeDescription
-tstringShutdown timeout in seconds
SERVICEstringOptional selected service

Working Example

Example Snippetdocker
docker compose -f compose.yaml -p bm-v12-lifecycle stop -t 5 worker
Docker Reference