#DOCKER_FILE
The configuration file. Sets up a Docker container when you run docker build
on it. Vastly preferable to docker commit
.
Here are some common text editors and their syntax highlighting modules you could use to create Dockerfiles:
- If you use jEdit, I've put up a syntax highlighting module for Dockerfile you can use.
- Sublime Text 2
- Atom
- Vim
- Emacs
- For a most comprehensive list of editors and IDEs, check [Docker meets the IDE] (https://domeide.github.io/)
- .dockerignore
- FROM Sets the Base Image for subsequent instructions.
- MAINTAINER Set the Author field of the generated images..
- RUN execute any commands in a new layer on top of the current image and commit the results.
- CMD provide defaults for an executing container.
- EXPOSE informs Docker that the container listens on the specified network ports at runtime. NOTE: does not actually make ports accessible.
- ENV sets environment variable.
- ADD copies new files, directories or remote file to container. Invalidates caches. Avoid
ADD
and useCOPY
instead. - COPY copies new files or directories to container.
- ENTRYPOINT configures a container that will run as an executable.
- VOLUME creates a mount point for externally mounted volumes or other containers.
- USER sets the user name for following RUN / CMD / ENTRYPOINT commands.
- WORKDIR sets the working directory.
- ARG defines a build-time variable.
- ONBUILD adds a trigger instruction when the image is used as the base for another build.
- STOPSIGNAL sets the system call signal that will be sent to the container to exit.
- LABEL apply key/value metadata to your images, containers, or daemons.
- Examples
- Best practices for writing Dockerfiles
- Michael Crosby has some more Dockerfiles best practices / take 2.
- Building Good Docker Images / Building Better Docker Images
- Managing Container Configuration with Metadata