Dockerfile Generator
Compose a Dockerfile without hand-writing Docker syntax: choose a base image, set the working directory, add environment variables, pick EXPOSE ports, type RUN commands and a default CMD. The tool emits a clean, conventional Dockerfile with predictable layer ordering, quoted ENV/CMD forms that handle special characters safely, and validates numeric ports.
🔒 100% Client-Side & Private — processed locally in your browser. Files never leave your device.
Options
Your result will appear here
Type or paste your input above, adjust the options, then press Run. Tip: press Ctrl+Enter to run, and ? for every shortcut.
How it works
What the Dockerfile Generator emits
Fill in fields and the generator returns a complete Dockerfile in caching-friendly order: FROM, WORKDIR, one ENV line per variable, your COPY lines, RUN steps, any ENTRYPOINT, EXPOSE ports and a CMD, with comment separators between the stages. The base image is emitted verbatim, so tags, digests and private registries all work.
When to sketch a Dockerfile here
Use it when you are starting an image and would rather fill a form than recall Docker syntax, or when you want a conventional layer order to compare your own file against. It also handles the JSON-array quoting rules for ENTRYPOINT and CMD for you.
The fields that matter
Base image defaults to node:20-alpine, WORKDIR must be absolute, and Environment, COPY and RUN are typed one entry per line. Ports are comma-separated. ENTRYPOINT is optional; when it is set, the note reminds you that CMD becomes its default arguments.
Rules the generator enforces
A missing base image, a relative WORKDIR, a COPY line without exactly two tokens, a missing CMD and a non-numeric EXPOSE port each raise an error showing the right form. ENTRYPOINT and CMD are always written as JSON arrays so values with spaces and quotes survive.
Nothing leaves the browser
The file is assembled on your device from what you type; no image is built and nothing is sent anywhere.
Questions
What does the generated file look like?
A conventional Dockerfile: FROM, WORKDIR, ENV (one line per variable), COPY lines, then RUN steps, EXPOSE and finally ENTRYPOINT (if set) and CMD. Order follows the common optimised-for-caching layout.
Are special characters handled?
ENTRYPOINT and CMD are emitted in their JSON array form so values with spaces and quotes stay intact, instead of the fragile shell form.
Do I need a base image with a tag?
A tag is recommended but not required — whatever you type in “Base image” is emitted verbatim, so private registries and digests work too.
Related tools
See categorydocker-compose.yml Generator
Build a docker-compose.yml for one service — image, ports, environment, volumes and restart policy.
JSON to .env
Flatten a JSON config into .env lines: VAR__NESTED=value, arrays as JSON, quoting handled.
.env <-> JSON
Parse a .env file into JSON, or turn a JSON object into .env text. Runs entirely on your device.
Glob Tester
Match a glob pattern against file paths: *, **, ?, [...] classes and {a,b} sets.