Show Menu
Cheatography

Docker Cheat Sheet (DRAFT) by

Docker Basics Docker Basics Docker Basics

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Images

docker images
Show existing images
 

Container

docker ps
Show running container
docker ps -a
Show all container (including stopped container)
docker run <im­age>
Create and start container from <im­age>
docker stop <co­nta­ine­r>
Stop the container <co­nta­ine­r>
docker rm <im­age>
Remove the container <co­nta­ine­r>
docker build --tag <im­age>
Load build definition from Dockerfile

Docker Run Options

docker run --port XX:YY <im­age>
Create a port mapping
docker run --rm <im­age>
Remove container when stopped
docker run --volume <im­age>
Mount a volume into container
docker run --tag NAME <im­age>
Create a container called NAME