El Ruso
El Ruso

Reputation: 15901

docker-compose down can't stop all containers

I start docker-compose this way: docker-compose -f docker-compose.yml -f docker-compose.prod.yml up and when I execute docker-compose down --remove-orphans only containers described in docker-compose.yml affected. How to kill them all?

Upvotes: 0

Views: 1928

Answers (1)

Leo
Leo

Reputation: 1830

You should use the -f flag in the docker-compose down command again.

Have you tried: docker-compose -f docker-compose.yml -f docker-compose.prod.yml down --remove-orphans?

Side Note:

  • If this is one docker-compose setup, I would recommend to use one compose file.
  • You can always fall back to executing multiple commands: docker-compose down --remove-orphans && docker-compose -f docker-compose.prod.yml down --remove-orphans

Upvotes: 2

Related Questions