Docker CLI Cheatsheet
Container virtualization and orchestration syntax cheatsheet — cover runtimes, images, storage networking, and compose layouts.
Container Management
docker run -d -p 80:80 [img]
Run a container in the background (detached) with port forwarding.
docker run -d -p 8080:80 nginx
docker ps
List running containers. Add `-a` to show stopped ones.
docker ps -a
docker stop [id]
Stop a running container gracefully.
docker stop webserver-01
Images operations
docker build -t [name] .
Build a Docker image from a local Dockerfile in current directory.
docker build -t myapp:1.0 .
docker images
List all local Docker images stored on system.
docker images | grep myapp
docker rmi [img]
Remove one or more images from the host system.
docker rmi nginx:alpine
No matching syntax found
Verify your query spelling or try searching another keyword.