[英]docker not found when building in Jenkins
I am trying to make sure my docker work or not in my Jenkins, I am running Jenkins in docker and it was running but when I check in Jenkins Pipeline, it said docker: not found
I am trying to make sure my docker work or not in my Jenkins, I am running Jenkins in docker and it was running but when I check in Jenkins Pipeline, it said docker: not found
here is my docker-compose.yml
这是我的docker-compose.yml
version: '3.7'
services:
jenkins:
image: jenkinsci/blueocean:latest
user: root
privileged: true
restart: always
ports:
- 8080:8080
volumes:
- ./jenkins_home:/var/jenkins_home
- /var/run/docker.sock:/var/run/docker.sock
- /usr/bin/docker:/usr/bin/docker
registry:
image: registry
container_name: registry
restart: always
ports:
- 5000:5000
then I run sudo docker-compose up -d
then the Jenkins is running, can I know why the docker not found?然后我运行sudo docker-compose up -d
然后 Jenkins 正在运行,我能知道为什么没有找到 docker 吗? is my docker-compose wrong?我的 docker-compose 错了吗?
You do not need to bind - /usr/bin/docker:/usr/bin/docker
, as - /var/run/docker.sock:/var/run/docker.sock
is engough to interact with host docker.您不需要绑定- /usr/bin/docker:/usr/bin/docker
,因为- /var/run/docker.sock:/var/run/docker.sock
足以与主机 docker 交互。 you should not bind executable with docker container您不应将可执行文件与 docker 容器绑定
remove this from the compose file and it should work.从撰写文件中删除它,它应该可以工作。
- /usr/bin/docker:/usr/bin/docker
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.