Dockerfile generator
Pick a stack, adjust the defaults if you need to, and get a working
Dockerfile plus a matching .dockerignore.
Runs entirely in your browser; nothing is uploaded.
About this tool
A working first Dockerfile for most projects is largely boilerplate — a base image, a working directory, an install step, a copy, an exposed port and a start command — but getting the details right (which files to copy first for good layer caching, exec-form vs shell-form CMD, a sensible multi-stage build for a compiled language) takes a bit of Docker-specific knowledge. This page fills in that boilerplate from a few choices, so you have something correct to start from and adjust.
How it works
Node.js and Python default to a single-stage build with dependency files copied and installed before the rest of the source, so Docker's layer cache can skip the install step on rebuilds where only your code changed, not your dependencies. Node.js also offers an optional second build stage that runs your build command and copies only the result into the final image, keeping devDependencies out of what actually ships. Go always uses a two-stage build — compiled in a full Go image, then copied as a single binary into a minimal Alpine image — because that's the standard way to keep a compiled Go image small.
Common questions
Why does my start command get split into a list?
Docker's exec form, CMD ["npm", "start"], runs the process directly rather than through a shell, which handles signals (like Ctrl-C or a container stop) correctly. This page splits your command on whitespace to build that list — see Known limitations for what that doesn't handle.
Do I need the .dockerignore file too?
Strongly recommended — without it, COPY . . also copies things like node_modules/, .git/ or a local .env into the image, which is slow at best and a real secret-leak risk at worst.
Why alpine/slim base images by default?
Smaller images pull faster and have a smaller attack surface. They're a sensible default, not a rule — swap the base image field for the full variant if you hit a missing-system-library problem alpine/slim sometimes cause.
Known limitations
Naive command splittingThe start/build command fields are split on plain whitespace to build the exec-form array — a command that needs quoted arguments with spaces inside them won't split correctly. Edit the generated array by hand for anything unusual.No dependency-lock detectionThis page can't see your actual repository, so it can't detect which lockfile or package manager you're really using — it takes your word for it via the package manager field.A starting point, not a finished imageReal production Dockerfiles often also need a non-root user, health checks, and pinned digest (not just tag) base images — none of which this generator adds automatically.
The same job at the command line
docker build -t my-app .Build an image from the generated Dockerfile in the current directory.docker run -p 3000:3000 my-appRun it, mapping the container's exposed port to the same port on your machine.docker build --progress=plain --no-cache -t my-app .Rebuild ignoring the layer cache — useful when debugging why a change isn't showing up.
More tools
See the whole toolbox — thirty-seven free tools planned, all running in your browser.