1
votes

Hi I am trying to create jenkins pipeline to build my .net core application. I am facing issue in jenkins file. Below is my jenkins file.

pipeline {

  agent none
    stages {
          stage('Build') {
      agent {
        docker {
          image 'microsoft/dotnet:2.1-sdk'
          args '-u root:root'
        }
      }

      steps {
       node {
         checkout scm
      }
      }
    }
   }
}

Whenever I build, I get the below error.enter image description here

Can someone help me to fix this issue? Any help would be appreciated. Thanks

1

1 Answers

0
votes

I believe that if you want to use, node then label is a required argument.

Something like:

node {
    label 'my-defined-label'
}

You can read more here: https://jenkins.io/doc/book/pipeline/syntax/