Choose a base image
Pick a common preset or type a custom image and tag.
Pick a base image and add your instructions — a correctly ordered, valid Dockerfile builds live as you go.
Pick a common preset or type a custom image and tag.
List your COPY/ADD, RUN and ENV entries, plus the port to expose.
Get a correctly ordered, ready-to-build Dockerfile.
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.
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.
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.