You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

自建Linux Shell版Bitbucket Runner无法调用Docker守护进程求助

自建Bitbucket Linux Shell Runner中Docker命令执行失败问题

在自建的linux.shell类型Bitbucket Runner节点上,Docker服务已处于运行状态,但bitbucket-pipelines.yml中的Docker命令无法正常执行。通过SSH登录同一实例运行相同命令却能正常工作。

配置文件

bitbucket-pipelines.yml内容如下:

pipelines:
  default:
    - step:
        name: Deploy to production
        runs-on:
          - 'linux.shell'
          - 'self.hosted'
        # trigger: manual  # Uncomment to make this a manual deployment.
        script:
          - echo "Deploying to production environment"
          - sudo lsof -i -P -n
          - systemctl --type=service --state=running
          - docker ps -a
          - chmod +x start-server.sh
          - ./start-server.sh

环境信息

  • echo $PATH输出:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

  • which docker输出:/usr/bin/docker

报错信息

执行docker ps -a时出现以下错误:

+ docker ps -a

Cannot connect to the Docker daemon at tcp://localhost:2375. Is the docker daemon running?

内容的提问来源于stack exchange,提问作者Evryvilanislemn

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.21 10:12:11