Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

610
Views
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

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

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

over 4 years ago · Santiago Trujillo Report

0

instead of agent { docker { image 'node:12.16.2' args '-p 3000:3000' } }

try agent { any { image 'node:12.16.2' args '-p 3000:3000' } }

that worked for me.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!