相关疑难解决方法(0)

使用Docker Jenkins容器管道构建docker镜像时找不到Docker

我有一个Jenkins作为docker容器运行,现在我想使用管道构建一个Docker镜像,但Jenkins容器总是告诉Docker找不到.

[simple-tdd-pipeline] Running shell script
+ docker build -t simple-tdd .
/var/jenkins_home/workspace/simple-tdd-pipeline@tmp/durable-
ebc35179/script.sh: 2: /var/jenkins_home/workspace/simple-tdd-
pipeline@tmp/durable-ebc35179/script.sh: docker: not found
Run Code Online (Sandbox Code Playgroud)

以下是我运行Jenkins图像的方法:

docker run --name myjenkins -p 8080:8080 -p 50000:50000 -v 
/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock 
jenkins
Run Code Online (Sandbox Code Playgroud)

而Jenkins图像的DockerFile是:https: //github.com/jenkinsci/docker/blob/9f29488b77c2005bbbc5c936d47e697689f8ef6e/Dockerfile

jenkins docker dockerfile jenkins-pipeline

17
推荐指数
4
解决办法
2万
查看次数

标签 统计

docker ×1

dockerfile ×1

jenkins ×1

jenkins-pipeline ×1