Search code examples
dockerdockerfile

Does Docker FROM Keyword in Dockerfile look for the newest image?


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


Solution

  • 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 .