jenkins构建时报错ERROR: Cannot run program “docker“ (in directory “/var/jenkins_home/workspace/

时间:2024-04-01 22:15:18

jenkins构建时,提示找不到docker文件如图
jenkins构建时报错ERROR: Cannot run program “docker“ (in directory “/var/jenkins_home/workspace/
然后我进入jenkins的容器内,docker exec -it jenkins /bin/bash
结果docker 命令无法执行
所以jenkins没有挂载成功docker
把jenkins容器删了,重新构建一个容器
docker run -d
–name jenkins
–restart=always
-u root
-p 8080:8080
-p 50000:50000
-v /var/jenkins_home:/var/jenkins_home
-v /var/run/docker.sock:/var/run/docker.sock
-v $(which docker):/usr/bin/docker
jenkins/jenkins:lts
问题解决