1

I have a CI Runner that automatically builds a docker image from a Dockerfile. My docker image is based on another docker image. So the beginning of my Dockerfile looks like this:

FROM linktoimage/imagename:latest

Does docker check during the build process if my local version of imagename is still the latest (similar to docker pull? Because i noticed that my ci runner shows sn older version of imagename if i run docker images on it

Paolo
  • 21,270
  • 6
  • 38
  • 69
Gian Alessio
  • 95
  • 1
  • 9

2 Answers2

2

Does docker check during the build process if my local version of imagename is still the latest (similar to docker pull)?

No, docker will not do this by default because of the build cache. It will use whatever existing image it has locally in the cache [1].

You can however enable the behavior you desire by using the --no-cache option:

$ docker build . --no-cache=true
Paolo
  • 21,270
  • 6
  • 38
  • 69
0

Docker does not check for newer version of remote image. When building, Docker first check to see if the base image is in the local cache. If it finds it is uses it, otherwise it tries to pull it from the remote repository.

Source: https://stackoverflow.com/a/47327944/88513

Oliver Weichhold
  • 10,259
  • 5
  • 45
  • 87