我正在尝试从 bitbucket runner(linux.shell) 运行 docker 命令,即使 docker 服务正在运行(如图所示),bitbucket-pipelines.yml 中的命令也不起作用。
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
我现在希望运行 docker 命令。 在上图所示的同一实例中执行运行程序时,docker 命令工作正常。 按照在位桶存储库中创建运行程序时所述使用 self.hosted linux.shell
回显$PATH:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
哪个码头工人: /usr/bin/docker
相关图片: 显示 docker 守护进程如何不工作:https://ibb.co/vQw5X5g 回显$PATH:https://ibb.co/6y2TPRQ
错误:
+ docker ps -a
Cannot connect to the Docker daemon at tcp://localhost:2375. Is the docker daemon running?
我在詹金斯工作节点中遇到了类似的问题,添加
sleep 60
就像一个魅力。