Day 27 : Jenkins Declarative Pipeline with Docker

Day 27 : Jenkins Declarative Pipeline with Docker

DevOps Learning

Table of contents

Day 26 focused on a Declarative pipeline. Let's now integrate Docker with your Jenkins declarative pipeline.

TASK :

Create a docker-integrated Jenkins declarative pipeline using the dockerfile, groovy syntax inside the stage block.

  • Create a new pipeline.

  • Set the following configurations:

  • In pipeline script:

      pipeline {
          agent { dockerfile true}
          stages {
              stage('Python Installiation Check') {
                  steps {
                      sh 'python --version'
                  }
              }
          }
      }
    
  • Save and Build Now, and you should see something like that:

To learn more about "Declarative Pipeline with Docker " you can check this .

Thank you for reading😉.