Show Menu
Cheatography

Docker Cheat Sheet (DRAFT) by

Docker

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

Boot2D­ocker

Create a new Boot2D­ocker VM
boot2d­ocker init
Start the VM and daemon
boot2d­ocker start
Display the enviro­nment variables for the Docker client.
boot2d­ocker shellinit
Display the boot2d­ocker status
boot2d­ocker status
Stop the boot2d­ocker applic­ation.
boot2d­ocker stop
Upgrade boot2d­ocker
boot2d­ocker upgrade
Get the address of the boot2d­ocker VM.
boot2d­ocker ip
ssh into boot2d­ocker vm
boot2d­ocker ssh
 

Docker client

pull a image from Docker Hub
docker pull <im­age­-na­me>
run a image(­maybe include pull)
docker run <im­age­-na­me>
list all local images
docker images
list all running containers
docker ps
list all contai­ner­s(i­nclude existed contra­iners)
docker ps -l
stop container
docker stop <co­nta­ine­r-n­ame>
remove container
docker rm <co­nta­ine­r-n­ame>
display ports exposed by container
docker port <co­nta­ine­r-n­ame>

container

docker run -t -i
run container intera­ctively
docker run -d
run container daemonized
docker logs <co­nta­ine­r>
fetch the logs of a container