Containers, visually

Dockerfile Generator

Pick a base image and add your instructions — a correctly ordered, valid Dockerfile builds live as you go.

Dockerfile

        

How it works

1

Choose a base image

Pick a common preset or type a custom image and tag.

2

Add instructions

List your COPY/ADD, RUN and ENV entries, plus the port to expose.

3

Copy or download

Get a correctly ordered, ready-to-build Dockerfile.

FAQ

What order should Dockerfile instructions be in?

A conventional order is FROM, WORKDIR, COPY/ADD, RUN, ENV, EXPOSE, then CMD or ENTRYPOINT. This tool always outputs instructions in that order regardless of the order you add them in the form.

What is the difference between CMD and ENTRYPOINT?

CMD provides default arguments that can be overridden when the container starts, while ENTRYPOINT sets the fixed command that always runs. Many images use ENTRYPOINT for the executable and CMD for default arguments.

What is exec form versus shell form?

Exec form, like CMD ["node", "server.js"], runs the command directly without a shell. Shell form, like CMD node server.js, runs it through /bin/sh -c, which allows shell features like variable expansion.

Try other tools