• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

384
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 3 years ago · Santiago Trujillo
2 answers
Answer question

0

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

over 3 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 3 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 Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error