【问题标题】:Jenkins pipeline exception - Getting docker not found詹金斯管道异常 - 找不到码头工人
【发布时间】:2019-05-02 12:30:57
【问题描述】:

我在 azure kubernetes 服务上运行 Jenkins 服务,并且我有简单的管道脚本来构建我的演示 Angular 项目..

pipeline {
 agent any 
 stages {
 stage(‘Build’) {
        steps {
            checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'mygithub', url: 'https://github.com/prabaharanit/docker-angular-example']]])
        }
    }

 stage('Fetch dependencies') {
  agent {
    docker 'circleci/node:9.3-stretch-browsers'
  }
  steps {
    sh 'yarn'
    stash includes: 'node_modules/', name: 'node_modules'
  }
}
}
}

当我构建管道时,我遇到了错误,

/var/jenkins_home/workspace/worklist-pipeline@2@tmp/durable-ec84fb4d/script.sh: 码头工人:没有找到。

如何让 Jenkins 使用我的主机 docker 容器进行构建.. 这是为了测试目的,我想使用我的主机 docker 来运行构建和创建图像.. 我已经尝试添加 docker form 全局工具配置.. 但它不起作用。

【问题讨论】:

    标签: docker jenkins azure-aks


    【解决方案1】:

    为了使用您的 Jenkins 主机 docker 引擎。从管道中删除以下代理语句 -

      agent {
        docker 'circleci/node:9.3-stretch-browsers'
      }
    

    PS - 你可以在舞台上使用agent { label 'master' },只要你想使用 Jenkins 主机。

    【讨论】:

      猜你喜欢
      • 2020-09-29
      • 2018-07-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-17
      • 2017-05-04
      • 2019-07-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多