Skip to content
koducathome

Docker Command Helper

Search common Docker tasks — run, build, debug, clean up — and get the exact command with an explanation and a warning when it deletes data.

How to use this tool

Steps for using the Docker Command Helper.

  1. Describe what you want to do in the search box — for example run with port, view logs or free disk space — or pick a category on the left.
  2. Fill in the fields on a card (image, container name, ports…). The command updates as you type, and invalid values such as an uppercase image name are flagged.
  3. Read the explanation under each command, and pay attention to cards marked Use with care — they delete containers, images or volume data.
  4. Click Copy on a command line and paste it into your terminal.

Example

Run nginx and publish it on port 8080

Search + fields
run with port
Host port: 8080   Container port: 80
Name: web         Image: nginx:1.27-alpine
Command
docker run -d -p 8080:80 --name web nginx:1.27-alpine

Common use cases

  • Remembering the exact flags for publishing ports, mounting folders or setting environment variables.
  • Debugging a misbehaving container with logs, exec, inspect and stats.
  • Cleaning up disk space safely without deleting the wrong volume.
  • Preparing an image for a registry: tagging, logging in and pushing.
  • Teaching teammates the Docker commands they will use every day.

How the Docker command helper works

The helper is a curated catalogue of everyday Docker CLI tasks grouped into images, builds, running and managing containers, debugging, volumes, networks, Compose, registries, cleanup and system commands. Search matches your words against each task's title, keywords and the command itself, so both “delete stopped containers” and “container prune” find the same card.

Placeholders such as <image> or <host-port> become input fields. Values are checked against Docker's rules — image references must be lowercase, ports must be 1–65535, environment variables must look like KEY=value — and anything containing spaces or shell characters is quoted safely before it is inserted.

Commands that remove containers, images or volumes are marked Use with care with a short explanation of what is lost. docker system prune -a --volumes and docker compose down -v in particular delete data that cannot be recovered.

Everything runs in your browser; nothing is executed. Commands target the Docker Engine CLI and Compose v2 (docker compose, not the older docker-compose).

Limitations

  • Covers common Docker Engine and Compose v2 commands, not every flag. See docker <command> --help for the full reference.
  • Commands use POSIX shell syntax (e.g. "$(pwd)"); adjust paths and quoting for Windows PowerShell or cmd.

Frequently asked questions

What is the difference between `docker run` and `docker exec`?

docker run creates and starts a new container from an image. docker exec runs an extra command inside a container that is already running — for example to open a shell for debugging.

How do I free up disk space used by Docker?

Start with docker system df to see what uses space, then docker system prune to remove stopped containers, unused networks, dangling images and build cache. Add -a to remove all unused images, and --volumes only if you are sure no volume data is needed.

Does `docker compose down` delete my database?

Not by default — it removes containers and networks but keeps named volumes. docker compose down -v also removes the volumes, which deletes the data stored in them.

Why is my image name rejected?

Docker repository names must be lowercase and may contain digits, dots, dashes and underscores, optionally prefixed by a registry host and followed by a :tag. MyApp:Latest is invalid; myapp:latest is fine.