docker-compose-stop

stop Compose services without removing containers

TLDR

Stop all running services
$ docker compose stop
Stop specific services
$ docker compose stop [service1] [service2]
Stop with a custom timeout in seconds
$ docker compose stop -t [30]
Use a specific compose file
$ docker compose -f [path/to/compose.yaml] stop

SYNOPSIS

docker compose stop [options] [SERVICE...]

DESCRIPTION

docker compose stop stops running containers for one or more services defined in a Compose project without removing them. Stopped containers keep their configuration and volumes and can be started again with docker compose start.Unlike docker compose down, this command does not remove containers, networks, or volumes. It is useful when you want a temporary stop while preserving the ability to resume the same containers quickly.

PARAMETERS

-t, --timeout seconds

Shutdown timeout in seconds before killing containers

INSTALL

sudo apt install docker-compose
sudo dnf install docker-compose
sudo pacman -S docker-compose
sudo apk add docker-cli-compose
sudo zypper install docker-compose
brew install docker-compose
nix profile install nixpkgs#docker-compose

SEE ALSO

docker-compose(1), docker-compose-up(1), docker-compose-down(1)

RESOURCES

Documentation · Homepage