• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Pruebas Online
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

359
Vistas
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

about 3 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

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

about 3 years ago · Santiago Trujillo Denunciar

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.

about 3 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda