Docker Typing Drills
Docker splits your typing between two grammars: UPPERCASE Dockerfile instructions and hyphen-dense CLI commands. Fluency in both means container workflows stop interrupting your development flow.
Two Grammars, One Workflow
Dockerfiles capitalize their instruction verbs β `FROM`, `RUN`, `COPY`, `CMD` β creating caps bursts like SQL's, followed by lowercase arguments with special forms: image tags with colons (`node:20-alpine`), stage aliases (`AS builder`), and the JSON-array CMD syntax (`["node", "dist/index.js"]`) that mixes brackets, quotes, and commas in one line. Multi-stage builds repeat the pattern with `--from=builder` flags bridging stages.
The CLI side is flag-heavy even by terminal standards: `docker run -d --name api -p 8080:8080 --env-file .env` chains short flags, long flags, and colon-separated port mappings. Cleanup commands stack flags (`system prune -af --volumes`), and exec sessions end in shell paths. Drilling both the file format and the commands builds complete container fluency.
Key Drills for Docker:
- Caps instructions: `FROM`, `RUN`, `COPY` start every Dockerfile line. Hold Shift through the word like SQL keywords.
- Colon-separated pairs: Image tags and port maps both use colons: `node:20`, `8080:8080`. Make the pattern automatic.
- Flag stacking: Drill `-d --name x -p` sequences β real docker run commands chain five or more flags.
Sample Drill: Multi-stage Dockerfile
Building production node servers with multi-stage layers.
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM node:20-alpine AS runner
WORKDIR /app
COPY --from=builder /app/dist ./dist
CMD ["node", "dist/index.js"]The Symbols That Slow You Down
The keystrokes below are where Docker typing speed is won or lost. Key positions shown for QWERTY β the pattern transfers to any layout, just on different physical keys.
| Symbol | Used For | Keys | How to Drill It |
|---|---|---|---|
| --flag | Long flag | Two hyphens, then word | `--name`, `--env-file`, `--rm` β double-dash flags chain five deep in real docker run commands. |
| : | Tag / port pair | Shift+Semicolon | `node:20-alpine`, `-p 8080:8080` β colon-separated pairs in both image names and port maps. |
| \ | Line continuation | Unshifted, above Enter | Dockerfiles continue lines with a trailing backslash β an end-of-line reach that must be reflexive. |
| FROM | Instruction caps | Hold Shift through the word | Dockerfile verbs are uppercase β the same caps-burst discipline as SQL keywords. |
| ["β¦"] | JSON-array form | Brackets as Shift+[ Shift+], quotes as Shift+Apostrophe | `CMD ["node", "dist/index.js"]` mixes brackets, quotes, and commas in one line. |
| $() | Build-time substitution | $ as Shift+4, then () as Shift+9 and Shift+0 | Variable expansion inside RUN commands and compose files. |
Common Docker Typing Mistakes
- βDropping the trailing backslash on continued Dockerfile lines β the build fails on the next line.
- βTyping single hyphens for long flags (`-name` versus `--name`) β train the double-dash as its own stroke pair.
- βForgetting the colon in port mappings: `-p 8080 8080` does something entirely different.
What's a Good Docker Typing Speed?
Docker typing alternates caps bursts and flag chains: 30β45 WPM with 96%+ accuracy is solid working speed, and full `docker run` invocations should flow without re-reading.