Docker useful commands


View logs of a container

docker logs -f CONTAINER

List all containers (only IDs)

docker ps -aq

Stop all running containers

docker stop $(docker ps -aq)

If you want also to delete containers & images do the following steps, otherwise stop here.

Remove all containers

docker rm $(docker ps -aq)

Remove all images

docker rmi $(docker images -q)