I'm trying to stop a container generated by a docker-compose up
but I can't find where this docker-compose was started. If I try to kill the docker container it is automatically recreated (as expected since it is docker-compose).
When running the command docker-compose ps
in the folder containing the docker-compose.yml
file I get an empty result, so it should be somewhere else...
How can I find where the docker compose is running and finally stop it?
Use docker ps -a | grep <certain_container>
docker ps -a | grep <certain_container>
Use locate docker-compose.yml
and find the one that you want Use docker-compose down
Option #1:
Install docker-compose
which would be available on your path using the official instructions - https://docs.docker.com/compose/install/ .
You can then go to the folder containing the docker-compose.yml
and run docker-compose down
.
Option #2:
Search for the file using something like:
find / -name "docker-compose"
You can then use the absolute path when running the command.
Option #3:
Update your containers restart policy:
docker update --restart=no container_name
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.