Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins. Invalid agent type "docker" specified. Must be one of [any, label, none]

My JenkinsFile looks like:

pipeline {     agent {          docker {              image 'node:12.16.2'             args '-p 3000:3000'         }      }     stages {         stage('Build') {             steps {                 sh 'node --version'                 sh 'npm install'                 sh 'npm run build'             }         }         stage ('Deliver') {             steps {                 sh 'readlink -f ./package.json'             }         }     } } 

I used to have Jenkins locally and this configuration worked, but I deployed it to a remote server and get the following error:

WorkflowScript: 3: Invalid agent type "docker" specified. Must be one of [any, label, none] @ line 3, column 9.            docker {  

I could not find a solution to this problem on the Internet, please help me

like image 953
Zimovik007 Avatar asked Jun 08 '20 00:06

Zimovik007


1 Answers

You have to install 2 plugins: Docker plugin and Docker Pipeline. Hope that helps.

like image 187
Valentine Shi Avatar answered Sep 21 '22 17:09

Valentine Shi