DEV Community

Pheak Pheasa
Pheak Pheasa

Posted on

Docker compose down with remove all everything related.

To stop and remove everything related to a Docker Compose setup (containers, networks, volumes, images, etc.), you can use the following command:

docker-compose down --rmi all --volumes --remove-orphans
Enter fullscreen mode Exit fullscreen mode

Explanation:

  • down: Stops and removes the containers, networks, and other resources created by docker-compose up.
  • --rmi all: Removes all images used by any service.
  • --volumes: Removes all named volumes declared in the volumes section of the docker-compose.yml file.
  • --remove-orphans: Removes any containers not defined in the docker-compose.yml file but are part of the same project.

This command will completely clean up everything related to the Docker Compose project.

Top comments (1)

Collapse
 
aniruddhadak profile image
ANIRUDDHA

Absolutely incredible! 😻.