Cheat Sheet
The commands you keep forgetting, with a one-line description and a real example you can copy - 629 across 38 tools. Pick a tool in the sidebar, or search across all of them.
Showing Docker. Choose another tool in the sidebar, or search all 629 commands.
Docker
Build, run, and manage containers and images.
| Command | What it does | Example |
|---|---|---|
docker run | Start a container from an image. | docker run -d -p 8080:80 nginx |
docker ps | List containers (add -a for stopped ones). | docker ps -a |
docker images | List the images on your machine. | docker images |
docker build | Build an image from a Dockerfile. | docker build -t myapp:1.0 . |
docker exec | Run a command inside a running container. | docker exec -it web bash |
docker logs | View (and follow) a container’s logs. | docker logs -f web |
docker stop | Stop a running container. | docker stop web |
docker rm | Remove a stopped container. | docker rm web |
docker rmi | Remove an image. | docker rmi myapp:1.0 |
docker pull | Download an image from a registry. | docker pull postgres:16 |
docker compose up | Start the services defined in a compose file. | docker compose up -d |
docker compose down | Stop and remove those services. | docker compose down |
docker exec env | Open a shell to debug a container. | docker exec -it postgres psql -U postgres |
docker cp | Copy a file out of (or into) a container. | docker cp web:/app/error.log ./error.log |
docker inspect | Show low-level details of a container. | docker inspect web |
docker system prune | Reclaim space by removing unused data. | docker system prune -af |