我有一个 Jenkins 作为 docker 容器运行,现在我想使用管道构建一个 Docker 映像,但 Jenkins 容器总是告诉 Docker not found。
[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
这是我运行 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
而Jenkins镜像的DockerFile是: https ://github.com/jenkinsci/docker/blob/9f29488b77c2005bbbc5c936d47e697689f8ef6e/Dockerfile
原文由 kitko112 发布,翻译遵循 CC BY-SA 4.0 许可协议
您缺少 docker 客户端。在 Dockerfile 中安装它:
资源