How do you stop Docker Compose services that were previously executed in a detached mode?
Experience Level: Junior
Tags: Docker Compose
Answer
Run the following command:
docker-compose stop
Note that this command won't remove the service containers.
Related Docker Compose job interview questions
How do you list all running containers that were created based on running Docker Compose?
Docker Compose JuniorHow do you stop Docker Compose services that were previously executed in a detached mode and also delete all their containers?
Docker Compose JuniorHow do you run services from a Docker Compose file in a detached mode?
Docker Compose JuniorHow do you re-build a service my-service that is defined in a Docker Compose file without running the service?
Docker Compose JuniorHow do you define a service in the docker-compose file?
Docker Compose Junior