DEV Community

loading...
Cover image for REMOVE COMMANDS IN DOCKER

REMOVE COMMANDS IN DOCKER

shiv
DevOps Engineer
・1 min read

Removing the Every Unused:

To remove all stopped containers, dangling images, and unused networks:

         docker system prune

But above command doesn't remove the unused volumes.To Remove unused volume:

       docker system prune --volumes

Removing the Docker Container:

To remove all stopped containers

          docker container prune

To Stop and Remove all Containers

Stop's All Containers

  docker container stop $(docker container ls -aq)

Remove's All Stopped Containers

    docker container rm $(docker container ls -aq)

Removing All Images:

Removes all Dangling Images:

       docker image prune

Removes all Unused Images

      docker image prune -a

Removing All Unused Volumes:

       docker volume prune

Removing all unused network:

    docker network prune

Discussion (0)