Valid Dockerfile Example: Node.js App That Passes Validation
Check a Dockerfile for an uppercase instruction, a FROM line, and a small set of argument shapes.
🔒 Processed entirely in your browser — nothing you enter here is ever uploaded.
The result appears on this page after you run the tool. Nothing you enter is uploaded.
Result
About this tool
This page opens the Dockerfile validator preloaded with a small, realistic Node.js build: a pinned `FROM node:18-alpine` base image, a `WORKDIR`, dependency install via `COPY` and `RUN npm ci`, the app source, an `EXPOSE`d port, and a `CMD` that starts the server. It follows the shape of an actual production Dockerfile rather than a toy example, and the validator confirms it the instant the page loads.
Every line here matters for a reason a real build would care about: `FROM` appears first so the image has a base to build on, the port passed to `EXPOSE` is a bare number the way Docker expects it, and every instruction keyword is uppercase, which is the Dockerfile convention the validator also checks for. None of that is decorative — change any one of them and the result below would flip to invalid.
Paste your own Dockerfile into the box to check it against the same rules, or edit this one directly — try lowercasing an instruction, or changing `EXPOSE 3000` to something malformed — to see exactly which line the validator flags and why.
Example. FROM ubuntu:22.04 followed by RUN echo hi passes. The lowercase word from fails. FROM --platform=linux/amd64 ubuntu:22.04 fails the image pattern. EXPOSE 80/http fails. EXPOSE 443/tcp passes.
Limit. Only the listed uppercase instructions are known. FROM arguments must match image:tag or image@digest, with an optional AS name. Platform flags and ${IMAGE} are rejected. No image is built.