Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kill docker-compose containers without docker-compose.yml file

I have some docker containers provisioned by docker-compose with restart: always flag. But I accidentally delete docker-compose.yml file.

How do I delete those containers so that they will not restart automatically?

like image 232
ntviet18 Avatar asked Dec 19 '17 10:12

ntviet18


1 Answers

Without the compose file, docker-compose can't guess the name of the containers that need to be killed. You need to do that manually using docker command:

docker container ls
docker rm -f <container-name-or-id>
like image 171
yamenk Avatar answered Sep 30 '22 15:09

yamenk