Skip to content

Docker: List and Remove all images and containers and Access

Docker Image and container
An instance of an image is called a container.

Docker: List and Remove all images and containers

List all containers

docker ps -a -q

Delete all containers

docker rm $(docker ps -a -q)

List all images

docker images -q

Delete all images

docker rmi $(docker images -q)

List Orphan Volume

sudo docker volume ls -qf dangling=true

Remove All Orphan Volume

sudo docker volume rm $(sudo docker volume ls -qf dangling=true)

Access into Docker

docker exec -it <mycontainer> bash

Leave a Reply

%d bloggers like this: