DEV Community

Discussion on: 21 Best Practises in 2021 for Dockerfile

Collapse
 
nfrankel profile image
Nicolas Frankel

Some of those are not "best practices" at all:

  1. Removing caches saves nothing unless it's && in the same RUN command. Do the test yourself.
  2. Less layers means less reusability. It's much better to have a 2 x 50MB layers and reuse the first one than to have a single 75MB that you need to overwrite every time.