Managing docker images and containers

Docker. Probably one of the best inventions since the sliced bread. It makes the life sooooo easy.

Some useful commands:

List images

docker images

Remove images

docker rmi  <IMAGE ID>

List containers

docker ps -a

Remove containers

docker rm  <CONTAINER ID>

Stop all containers

docker stop $(docker ps -a -q)

Remove all containers

docker rm $(docker ps -a -q)

Accessing to a container’s console

docker exec -it <name of the container> bash

Easy.

Leave a Reply

Your email address will not be published. Required fields are marked *