Remove exited containers: sudo docker rm $(docker ps -a -q -f status=exited) List all docker containers sudo docker ps -a Run docker container in interactive mode (execute shell of the container busybox for eg): docker run -it busybox sh Execute a single command for a container (busybox) project docker run busybox echo "hello from busybox" Download a docker image from the registry docker run prakhar1989/static-site Execute in -d (detached) mode -P (publish all the exposed ports) --name (just the name we want to give) docker run -d -P --name static-site prakhar1989/static-site To see the ports: docker port static-site specify port through which the container will forward the traffic docker run -p 8888:80 prakhar1989/static-site