title: How to restrict the jenkins pipeline docker agent in specific slave?
body: <p>I have several jenkins slaves configured and only label with <code>dockerserver</code> has docker env, then how can I restrict the jenkins pipeline docker agent in this slave?</p>
  
  <p>Below <code>Jenkinsfile</code> doesn't work, the <code>agent</code> inside <code>stage</code> will overwrite the defined slave <code>dockerserver</code></p>
  
  <pre>
  pipeline {
      agent { label 'dockerserver' }
      stages {
          stage('Back-end') {
              agent {
                  docker { image 'maven:3-alpine' }
              }
              steps {
                  sh 'mvn --version'
              }
          }
          stage('Front-end') {
              agent {
                  docker { image 'node:7-alpine' }
              }
              steps {
                  sh 'node --version'
              }
          }
      }
  }
  </pre>
  
  <p>It may pick other slave which doesn't have docker supported</p>
  
  <p>Any suggestion?</p>