Lists images
$ docker images
Removes an image
$ docker rmi <image-id>
Removes all images
$ docker rmi $(docker images -q)
Search for images
$ docker search <search-term>
List runing containers
$ docker ps
Lists all containers
$ docker ps -a
Retrieves logs present at the time of execution
$ docker logs
Runs container in interactive mode
$ docker run -ti <image-name> bash
Stops a container
$ docker stop <container-id>
Stop all containers
$ docker stop $(docker ps -a -q)
Removes a container
$ docker rm <container-id>
Remove all containers
$ docker rm $(docker ps -a -q)
Volume a folder in host to container
$ docker run -v ~/host-folder:/container-folder ubuntu
Exposes container 8080 to host 8080 host:container
$ docker run -p 8080:8080 <image-name>
Detach container (does not stop the container) 'Ctrl-p' + 'Ctrl-q'
Build a Dockerfile
$ docker build -t <alias-name> .