About Dockerfiles
This tool generates a Dockerfile from a few inputs — base image, working directory, dependency install, build and start commands. A Dockerfile is the recipe Docker uses to build a container image of your app. It runs in your browser.
How Dockerfile Generator works
How to use it
- Enter your base image and the commands.
- Copy the generated Dockerfile.
- Save it as
Dockerfileand rundocker build.
How it works
It assembles the standard instructions: FROM your base image, WORKDIR, copying and installing dependencies first (for better layer caching), copying the rest of the source, an optional build step, EXPOSE for the port, and CMD to start the app.
Common uses
- Create a Dockerfile for a Node app
- Containerise a project
- Learn Dockerfile structure
- Set up a build for CI
- Standardise a team Dockerfile
- Add a start command and port
- Speed up writing Dockerfiles
- Prototype a container image
Frequently asked questions
What is a Dockerfile?
A text file of instructions Docker uses to build a container image.
Where do I put it?
In your project root, named Dockerfile, then run docker build.
Why copy package files first?
It lets Docker cache the dependency layer so rebuilds are faster.
Is my input uploaded?
No — it is generated in your browser.
Can I use any base image?
Yes — enter any image, e.g. node, python or nginx.
Does it set the port?
Yes — EXPOSE is added if you provide a port.
Is it free?
Yes — completely free with no sign-up.