Docker Notes

> docker version
> docker info

# Run a new container
> docker run hello-world

# See running and stopped containers
> docker ps
> docker ps -a

> docker pull ubuntu # this pulls the latest version
> docker pull ubuntu:14.04
> docker rmi ubuntu:14.04

# Run image in interactive mode
# The following command enters to ubuntu (image) bash
> docker run -it --name temp ubuntu:latest /bin/bash 

# Don't type <code>exit</code> in the interactive shell because
# it will kill the container as well

&gt;&gt; Ctrl P + Q # to exit interactive shell

# Stop all running instances
# -aq: a is all and q is quietly
&gt; docker stop $(docker ps -aq) 

&gt; docker rm $(docker ps -aq) 

&gt; docker rmi $(docker images -q) 

Continue reading