Docker gotchas ( 2. Docker build with –no-cache)

There is always a misconception that, when you build an image from the dockerfile in a frequent interval, which has base image defined something like below [1], the base image updates ( for example a CVE or vulnerability fix) are by default pulled into your newly built image. This is wrong!

For ex:

FROM fedora21

Docker uses the caches when building and when there is no change in the instructions of Dockerfile, docker skips doing an update of the image to the latest version.

To avoid this, avoid the cache in build process, ie

#docker build -no-cache .

Digiprove sealCopyright secured by Digiprove © 2017 Humble Chirammal

Leave a Reply

Your email address will not be published. Required fields are marked *