Start with a small version of the base image: -
2. Create a multi-line argument in a structured way: -
3. Minimize the number of layers: -
4. Leverage the build cache: -
5. Order the steps in the Dockerfile from least to most frequently changing content: -
6. Prefer COPY over ADD:-
7. Only install what you need: -
8. Use Official images with tag specific and avoid the latest tag: -
9. Don’t store secret or sensitive information in Dockerfile: -
10. Don’t install SSH or similar service: -
11. Use .dockerignore file: -
12. Use multi-stage builds: -
13. Run container as non-root user: -
14. CMD vs ENTRYPOINT ?? : -