Cheat sheets / Docker

Docker Cheat Sheet

The 36 Docker commands you need most days: building images, running and debugging containers, Compose, and getting your disk space back. Click a command to copy it.

This page also works as a hotkey overlay. Hold Ctrl+Space to see it, let go to hide it. What is this?

Images

Run a container

In -p 8080:80 and -v ${PWD}:/app, your machine is on the left and the container is on the right.

Manage containers

Look inside

Docker Compose

down keeps your volumes. Add -v to delete them too, and with them the data in your database.

Free up disk space

After prune -a, the next build or pull downloads everything again.

Parts in {{double braces}} are blanks: click the command and you type the value before it is copied. docker compose (with a space) is the current command. docker-compose with a hyphen is the old standalone tool; the arguments are the same.

Keep this cheat sheet on a hotkey

BrainRAM is a small free app for Windows. Hold Ctrl+Space and this page appears on top of whatever you are doing. Let go and it's gone. Click a cell and it's copied.

Each row is one topic, named at its left edge, in the same order as this page. So free up disk space is always the bottom row, and after a few days you stop reading and just reach for the spot.

Cells with a blank, like {{name}}, ask you for the value first and copy the finished command, the same way they do on this page.

  1. Download BrainRAM Free, no account, works offline. The installer isn't code-signed yet, so Windows shows a blue warning: click More info, then Run anyway.
  2. Add this page to BrainRAM Opens BrainRAM with this page ready to import.

BrainRAM runs on Windows today. The macOS and Linux versions are on the way.

Email me when mine is ready
This page as BrainRAM shows it while you hold the hotkey.

More cheat sheets


      
Enter continue · Esc cancel