Like it!

Join us on Facebook!

Like it!

An essential Docker cheat sheet

All the best Docker commands that I keep forgetting.

Images

Action Command
Show all images docker images -a
Delete all images docker rmi $(docker images -a -q)
Pull remote image docker pull <image>

Containers

Action Command
Show all running containers docker ps
Show all running and stopped containers docker ps -a
Stop all containers docker stop $(docker ps -a -q)
Delete all containers docker rm $(docker ps -a -q)
Create and run a new container docker run <image tag> <commands>
Create a new container without running it docker create <image tag> <commands>
Run an existing container docker start <container id>
Run an existing container with STDIN, STDOUT and STDERR docker start -a -i <container id>

Dockerfile

Action Command
Build a Dockerfile docker build -t <image tag> <Dockerfile>
comments