Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-35497

If a docker image already exists, Docker Custom Build Environment will not pull a newer version of the image

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      While using Docker Custom Build Environment plugin, if an image already exists on a slave, it will not pull that image again even if that potential pulled image is newer than the one on the slave.

      This means that newer docker images will never be pulled so the image has to be forcibly deleted and then re-pulled.

        Attachments

          Activity

          Hide
          ctlam Dominic Lam added a comment -

          I have the same problem.  We have other group producing the container image regularly, and we want to use "latest" tag instead of keep updating the config for a specific version.

          We look at the code, there is a logic to determine if it should pull an image:

           if (forcePull || !docker.hasImage(expandedImage)) {

             boolean pulled = docker.pullImage(expandedImage)

          }

          and the hasImage() is actually calling "docker inspect" to see if it's returning a "0" status, assuming if the inspect is successful, the image exist and skip the pull altogether.

          Isn't it we don't even need this hasImage() check and just call docker pull regardless?  the docker pull is more intelligent to distinguish if it needs to pull an image or not because it's using hash.

          This way, it will make the force pull unnecessary because the docker pull is smart enough.  A better option is to have "skip pull" instead of "force pull" because in case people don't even want the docker pull to do the check-and-pull.

           

           

           

          Show
          ctlam Dominic Lam added a comment - I have the same problem.  We have other group producing the container image regularly, and we want to use "latest" tag instead of keep updating the config for a specific version. We look at the code, there is a logic to determine if it should pull an image:  if (forcePull || !docker.hasImage(expandedImage)) {    boolean pulled = docker.pullImage(expandedImage) } and the hasImage() is actually calling "docker inspect" to see if it's returning a "0" status, assuming if the inspect is successful, the image exist and skip the pull altogether. Isn't it we don't even need this hasImage() check and just call docker pull regardless?  the docker pull is more intelligent to distinguish if it needs to pull an image or not because it's using hash. This way, it will make the force pull unnecessary because the docker pull is smart enough.  A better option is to have "skip pull" instead of "force pull" because in case people don't even want the docker pull to do the check-and-pull.      

            People

            • Assignee:
              jonhermansen Jon Hermansen
              Reporter:
              ataylor Alex Taylor
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: