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

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

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      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.

        Attachments

          Activity

          kivagant Eugene G created issue -
          kivagant Eugene G made changes -
          Field Original Value New Value
          Description The problem looks close to JENKINS-25690 but it is related to the default Jenkins Pipeline functionality.
          {code:java}
          pipeline {
              agent { label 'master' }
              stages {
                  stage('Build') {
                      steps {
                          script {
                              image = docker.build('myorg/myapp:latest')
                          }
                      }
                  }
              }
          }{code}
           

          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.
          The problem looks close to JENKINS-25690 but it is related to the default Jenkins Pipeline functionality.
          {code:java}
          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 looks like now
                          }
                      }
                  }
              }
          }{code}
           

          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.
          kivagant Eugene G made changes -
          Description The problem looks close to JENKINS-25690 but it is related to the default Jenkins Pipeline functionality.
          {code:java}
          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 looks like now
                          }
                      }
                  }
              }
          }{code}
           

          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.
          The problem looks close to JENKINS-25690 but it is related to the default Jenkins Pipeline functionality.
          {code:java}
          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
                          }
                      }
                  }
              }
          }{code}
           

          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.
          kivagant Eugene G made changes -
          Description The problem looks close to JENKINS-25690 but it is related to the default Jenkins Pipeline functionality.
          {code:java}
          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
                          }
                      }
                  }
              }
          }{code}
           

          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.
          The problem looks close to JENKINS-25690 but it is related to the default Jenkins Pipeline functionality.
          {code:java}
          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
                          }
                      }
                  }
              }
          }{code}
           

          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.
          kivagant Eugene G made changes -
          Description The problem looks close to JENKINS-25690 but it is related to the default Jenkins Pipeline functionality.
          {code:java}
          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
                          }
                      }
                  }
              }
          }{code}
           

          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.
          The problem looks close to JENKINS-25690 but it is related to the default Jenkins Pipeline functionality.
          {code:java}
          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
                          }
                      }
                  }
              }
          }{code}
           

          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.

            People

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

              Dates

              Created:
              Updated: