Dockerfile structure doesn't make good use of layer caching
iantruslove opened this issue · 1 comments
iantruslove commented
Because we're copying in the entire build directory (here) any changes to any of the files in the project will bust Docker's build cache.
Splitting the ADD
s up into a few more pieces and taking action based only on changes introduced by that ADD
mean Docker can better optimize build times by eliminating unnecessary steps. The "cost" of additional ADD
s is more layers in the image, but the layers are independent so there's no real net negative (versus layers which significantly alter underlying layers which unnecessarily increases the total image size).
rovellipaolo commented
Fixed with your pull request: #14