简体   繁体   English

在 Jenkins 中构建时未找到 docker

[英]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.

相关问题 使用 Docker Z2E54334C0A5CE2ADAZE3E5A5845DF3AB3 构建 docker 映像时未找到 Docker - Docker not found when building docker image using Docker Jenkins container pipeline 使用Jenkins和Docker进行构建时“设备上没有剩余空间” - “no space left on device” when building with Jenkins and Docker 在 Docker 插件中构建 Jenkins 时安装失败 - When building Jenkins in Docker plugins fail to install 构建 docker 容器时 Kubernetes 上的 Jenkins 问题 - Issue with Jenkins on Kubernetes when building docker containers 使用Jenkins构建Docker镜像会导致“找不到支持的协议方案” - Building Docker images using Jenkins results in “Unsupported protocol scheme found” npm:构建 Docker 容器时未找到 - npm: not found when building Docker container 执行管道时未找到 Jenkins docker - Jenkins not found docker when execute pipeline docker:使用 Docker Jenkins 容器使用 docker 命令时未找到 - docker: not found when using docker command using Docker Jenkins container Jenkins在构建时是否缓存依赖项和Docker层? - Does Jenkins cache dependencies and Docker layers when building? 获取错误:使用 jenkins 构建 docker 映像时权限被拒绝 - Get error: permission denied when building docker image using jenkins
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM