The following are suggestions and practical advice for maintaining your container images:
- Keep a Dockerfile in your source repository. If your application source is by itself in a Git repository, then including a Dockerfile in the repository along with it makes a great deal of sense. You can reference files to COPY or ADD from the relative directory of where your source is located. It’s not uncommon to see a Dockerfile in the root of a repository, or if you're working from a monorepo with many projects, consider a Docker directory in the same directory as your project’s source code:
- If you want to take advantage of an automatic Docker build on Docker Hub, Quay, or another container repository, ...