⌨️
DevType.site

Docker Commands Practice Online: Free Container CLI Drills

·8 min read

Docker splits your typing between two grammars — UPPERCASE Dockerfile instructions and hyphen-dense CLI commands — and asks you to switch between them mid-thought. If docker run -d --name api -p 8080:8080 --env-file .env takes you three attempts to type cleanly, that's not a Docker knowledge gap; it's a typing gap. Here's what to drill and how to practice Docker commands online for free.

Skip ahead: start the free Docker typing drills — Dockerfile blocks, run commands, and container lifecycle workflows, timed for WPM and accuracy.

Why Docker is a typing problem

Container commands are the most flag-heavy typing in normal development. A realisticdocker run chains five or more flags — short ones (-d), long ones (--env-file), and value-carrying ones (-p 8080:8080) — and every one of them is a chance for the double-hyphen to become single, the colon to drop, or the flag order to scramble. Meanwhile the Dockerfile side demands SQL-style caps bursts (FROM,RUN, COPY) with JSON-array syntax mixed in.

And like Git, Docker errors after you press Enter: a mistyped flag usually means a rebuild, a re-pull, or a container that starts wrong. The accuracy bar is real.

Two grammars, one keyboard

ElementExampleTyping challenge
Caps instructionsFROM node:20-alpine AS buildHeld-Shift words, like SQL keywords
Short flags-d, -it, -rmHyphen-letter pairs, often stacked (-it --rm)
Long flags--name, --env-file, --from=builderDouble hyphen plus embedded hyphens and equals-values
Colon pairsnode:20-alpine, -p 8080:8080Shift-semicolon twice in one line, in different jobs
Line continuationsRUN apt-get update \Trailing backslash at line ends — end-of-line reach under Shift rhythm
JSON array formCMD ["node", "dist/index.js"]Brackets, quotes, and commas interleaved in one line
SubstitutionRUN echo $${NODE_ENV}Dollar-brace units inside shell commands inside caps lines

The 80/20 command list

FamilyLines worth typing verbatimTrains
Run & servedocker run -d --name api -p 8080:8080 --env-file .env myapp:latest, docker run -it --rm node:20-alpine shThe flag-stacking rhythm — five flags as one sentence
State inspectiondocker ps -a, docker logs -f --tail 50 api, docker inspect api, docker statsShort flags and equals-joined values (--tail=50)
Exec & debugdocker exec -it api sh, docker exec api cat /app/config.ymlThe -it pair and command-into-container flow
Imagesdocker build -t myapp:1.4 ., docker images, docker tag myapp:1.4 registry.io/myapp:1.4, docker push registry.io/myapp:1.4Tag colons and registry-path slashes
Cleanupdocker system prune -af --volumes, docker container prune, docker rmi $(docker images -f "dangling=true" -q)Stacked short flags and nested substitution
Composedocker compose up -d --build, docker compose logs -f web, docker compose down -vThe v2 space-separated grammar

Dockerfile patterns to drill

FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY . .
RUN npm run build

FROM node:20-alpine
WORKDIR /app
COPY --from=builder /app/dist ./dist
EXPOSE 8080
USER node
CMD ["node", "dist/index.js"]

A multi-stage build is the complete Dockerfile workout: caps instruction bursts, a colon-paired image tag, the --from=builder long flag, and the JSON-arrayCMD — all in fourteen lines. Typing it cleanly, twice a week, keeps every Dockerfile pattern in your hands rather than your copy-paste history.

Common Docker typing mistakes

  • Single hyphen on long flags. -name api fails where--name api works. Train the double-dash as its own stroke pair and this vanishes.
  • Dropped colon in port maps. -p 8080 8080 and-p 8080:8080 mean completely different things — the colon pair is not decoration.
  • Missing trailing backslash. A Dockerfile RUN that loses its line-continuation fails on the next line, which always takes a minute to spot.
  • Lowercase instructions. from node:20 errors immediately — a friendlier failure, but it breaks the caps-burst habit that Dockerfiles depend on.

How the online drills work

DevType's Docker practice alternates both grammars: Dockerfile blocks (multi-stage builds, alpine images, CMD arrays) and real CLI workflows (run, exec, logs, prune, compose). Live WPM and accuracy, thetimed 15/30/60-second modes, and a per-key heatmap that will usually call out the hyphen row after your first run.

Docker drills stack naturally with kubectl drills — same operational pressure, same long-flag grammar, and together they cover the container lifecycle end to end. If you carry a pager, the honest framing is that these drills are incident-response rehearsal: typing kubectl rollout undo deployment/api without hesitation at 2am is the skill, and drills are how you get it.

A two-week Docker fluency plan

DaysFocusDone when
1–3Run & inspect: docker run flag stacks, ps, logsFive-flag run commands type without re-reading
4–6Dockerfile grammar: caps bursts, colon tags, continuationsThe multi-stage build types cleanly twice in a row
7–10Images & registries: build, tag, push chainsRegistry paths (registry.io/app:1.4) flow
11–14Compose + cleanup + timed 30s runs, re-measureAccuracy ≥ 96% at your new WPM ceiling

Frequently asked questions

Should I learn docker CLI or docker compose?

Both, in that order. Compose abstracts the run flags away for multi-container apps, but you'll still live in exec, logs, and one-off containers daily — and compose files themselves are YAML, which has its owntyping discipline. Drill the raw CLI first; compose fluency rides on top of it.

Is Docker typing practice useful if I use Kubernetes?

Directly useful — kubectl inherited the long-flag-plus-value grammar (--tail=50, -n production) and adds resource-path patterns of its own. Most engineers type both tools in the same hour; thekubectl drills cover the cluster-specific half.

Why do my Docker commands always need a second attempt?

Almost always the hyphen row: double-dash long flags written as single-dash, or a flag interrupted mid-word while your brain was already composing the argument. Both are motor-pattern problems, not knowledge problems — which is exactly why two weeks of timed drills fixes what years of copying from docs didn't.

How fast should Docker commands be?

Around 30–45 WPM at 96%+ accuracy for real workflows — the caps bursts and flag stacks make it a notch slower than plain shell. The better benchmark is zero re-reads: if a five-flagdocker run types straight through without you looking at it again, you're fluent.

Put it into practice

DevType drills real code, terminal commands, and symbols — free, no account needed.

Start a Typing Drill