🐳 DevOps
Docker Cheat Sheet
This Docker cheat sheet lists the core commands for images, containers, Docker Compose, and cleanup. Filter instantly to find how to build, run, inspect, and remove containers and images from the command line.
Images
Build an image from a Dockerfile
List local images
Download an image from a registry
Remove an image
Add a new tag to an image
Containers
Run a container detached, mapping a port
List running containers
List all containers, including stopped
Open a shell inside a running container
Follow a container's logs
Stop a running container
Remove a stopped container
Docker Compose
Start all services in the background
Stop and remove services, networks
Follow logs from all services
List service containers
Build or rebuild service images
Cleanup
Remove unused data (stopped containers, networks)
Also remove all unused images
Remove unused volumes
Remove dangling images