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

This issue is archived. You can view it, but you can't modify it. Learn more

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.

            Assignee:
            Unassigned
            Reporter:
            Eugene G
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: