1

Does docker build --no-cache <args> pull new version of base image (e.g. --pull) or it's only disabling caching of Dockerfile commands?

Background:

I have multistage build where one of the source images is local only. The --pull option cannot be used in this case. Question is if --no-cache will force the pulling of remote base images.

dorny
  • 143
  • 1
  • 13
  • I’m pretty sure that won’t automatically pull, but I’m also pretty sure (even if it would) that nothing bad would happen if you tried it; it won’t delete the preexisting image even if it can’t pull an updated one. – David Maze Sep 18 '18 at 13:36
  • I tried it, but I was not sure if it's doing the pull or not. Right now all my local images have matching hash with what is available in repository. I will create a test setup for this and post the result... – dorny Sep 19 '18 at 15:34

1 Answers1

4

No, --no-cache will not result in a new pull of the base image.

lvthillo
  • 28,263
  • 13
  • 94
  • 127