Closed peteruithoven closed 6 years ago
Because I saw no need to create several storage layers and was not interested in using the build cache. I would rather get the latest stable releases for the the needed packages.
Also, from what I can tell, the cache would not be used because there's only one Dockerfile, it does not have sibling Dockerfiles for which to cache the layers.
Maybe I don't get Docker. How I understand is that I could separate:
That might be the case when working with Dockerfiles that have frequent updates, however, this is not the case.
Using build caches would also mean that if you do a new build to use the latest dependencies, those might not get updated unless you issue "--no-cache=true", this might be counter-intuitive.
But, isn't that the case anyway? That it will try to get the RUN command from cache. In your case it's just one, instead of multiple?
I've split the RUN command into multiple sections, the build should work better with caches now.
Currently the Dockerfile only has one RUN command. This means we don't use the build cache, which means when a step fails it has to start from scratch. Why would you do it that way? I understand from the Dockerfile best practices you shouldn't separate apt-get update and apt-get install, but why not put the rest in separate RUN's?