Show Menu
Cheatography

Basic Docker Cheat Sheet Cheat Sheet (DRAFT) by

Only Basic Docker command every developer need to know.

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

Managing

docker images -a
to view all images
docker ps -a 
to view all containers

Buildi­ng/­Running

docker build -t {image_name} .
to build an image from the docker file
docker run {image_id}
to run a container
docker run -d {image_id}
to run a container in background

Removi­ng/­Del­eting

docker rmi {image_id}
to remove an image
docker image prune
to remove all unused images
docker rm -f {contai­ner_id}
to remove a running container
docker container prune
to remove all unused container