Docker useful commands

List Docker local images

docker images

Start a container

# using image name
docker run -it python:3.6 /bin/bash

# using image id
docker run -it 8dbd9e392a96 /bin/bash

List docker processes

docker ps

# list included stopped processes
docker ps -a

Delete docker container

docker rm <container_id>

Delete docker image

docker rmi <image_id>

Stop all containers

docker stop $(docker ps -a -q)

Remove all containers

docker rm $(docker ps -a -q)