Docker Cheat Sheet
Updated July 27, 2026 · Written by PWNMI — see About.
Docker packages an application and everything it needs to run into a portable image, then runs it as an isolated container. On this site it's the standard way to reproduce a specific vulnerable version of real software for practice, without installing it directly on your own machine.
Red Team / Offensive Use
Docker's role in an engagement or lab context is almost always infrastructure, not the target itself: standing up an isolated copy of a specific vulnerable application to practice against (exactly what every CVE lab on this site does), running attack tooling (C2 frameworks, phishing infrastructure) in a disposable, easily-torn-down environment, or pivoting infrastructure like a relay or proxy container on a VPS. Understanding it well also matters defensively — misconfigured containers (exposed Docker sockets, unnecessarily published ports, containers run with excessive privileges) are a real and common finding in cloud/infrastructure assessments.
Established Cheatsheet
Docker CLI reference and the Compose CLI reference — the official documentation for every command and flag.
PWNMI's Top 7 Use Cases
docker compose up -d— start everything defined in adocker-compose.yml, detached; the standard first command for every lab on this sitedocker compose logs <service>— check a specific service's output; the first place to look when something isn't respondingdocker compose ps -a— list all containers including ones that crashed or exited; plainpshides thesedocker inspect $(docker compose ps -q <service>) --format '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'— get a container's own IP address, the standard way to reach a lab that deliberately publishes no portsdocker compose exec <service> sh— get an interactive shell inside a running container, useful for inspecting state directly rather than only through the application's own interfacedocker compose down -v— tear a lab down completely, including named volumes, so the next run starts cleandocker system prune -a --volumes— reclaim disk space from stopped containers, unused images, and volumes once you've accumulated a few labs' worth of leftovers
Next step
New to Docker entirely? Start with Docker for Security Labs for the concepts and the isolation pattern behind every command here. To see it applied against a real CVE, see CVE-2026-62183 (Apache Syncope).
Get new write-ups in your inbox
New roadmaps, tool walkthroughs, and lab write-ups. No spam. Unsubscribe anytime.