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

Allow to always pull base images for docker.build() in all pipelines

XMLWordPrintable

      The problem looks close to JENKINS-25690 but it is related to the default Jenkins Pipeline functionality.

      pipeline {
          agent { label 'master' }
          stages {
              stage('Build') {
                  steps {
                      script {
                          image = docker.build('myorg/myapp:latest')
                          // image = docker.build('myorg/myapp:latest', '--pull .') // how it must look like now
                      }
                  }
              }
          }
      }

       

      It would be nice to have a global option to force Docker to always pull base images before build ("--pull" argument). When you have a lot of Jenkinsfiles it is very hard to control that all of them pull base images before each build.

      Update: but with the ability to bypass the global setting for a specific line with docker.build(). There's a corner case when one image must be build FROM another one that also was built locally. In this situation "--pull" argument will break the second build because it hadn't been pushed to a registry yet.

            Unassigned Unassigned
            kivagant Eugene G
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: