Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

263
Visualizações
How to use a Jenkins tool installation in a docker container?

To reduce duplication of effort in my docker containers, I'd like to run pipeline steps both in a docker container, and with Jenkins tool installations available.

This naïve attempt doesn't work - npm is not found

pipeline {
  agent { dockerfile true }
  tools { nodejs 'LTS' }
  stages {
    stage('NPM') {
      steps { sh 'npm install-ci-test' }
    }
  }
}

Is this possible?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You can make it available when you configure the docker container by mounting the Jenkins folder on the build agent.

pipeline {
   agent {
      docker {
         ....
        // Make tools folder available in docker (some slaves use mnt while other uses storage)
        args '-v /mnt/Jenkins_MCU:/mnt/Jenkins_MCU -v /storage/Jenkins_MCU:/storage/Jenkins_MCU' 
        ...
      }
....
stage(...){
    environment {
        myToolHome = tool 'MyTool'
    }
    steps {
        ...
        sh "${myToolHome}/path/to/binary arguments" 
....

I am not sure how to get the path of the location for jenkins on the build agent, so in this example it is hard coded. But it makes the tool available in the docker image.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda