Docker Essentials


Here are some things that I’ve needed to know when working with Docker.


Terminology

In Docker terminology, “container” is the name for what I would otherwise call an “instance”.

How to

Start a container.

docker run -i -t ubuntu:14.04 /bin/bash

See the currently running containers.

docker ps

See all containers including ones that have exited.

docker ps -a

Save an image of an containers.

docker commit <container id or name> <new image name>

Get a shell inside a currently-running container.

docker exec -i -t <container id or name> /bin/bash

Restart a container that was previously stopped.

docker start <container id or name>