gpt4 book ai didi

docker - 如何运行Bitbucket管道在Nanobox上部署基于PHP的应用程序

转载 作者:行者123 更新时间:2023-12-02 19:55:29 25 4
gpt4 key购买 nike

我正在尝试为打算在nanobox.io上部署的基于php的(Laravel-Lumen)应用程序设置bitbucket管道。我希望此管道在提交代码更改后立即部署我的应用程序。

我的bitbucket-pipelines.yml看起来像这样

image: php:7.1.29

pipelines:
branches:
staging:
- step:
name: Publish to staging version
deployment: staging
caches:
- composer
script:
- apt-get update && apt-get install -y unzip
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install
# - vendor/bin/phpunit
- bash -c "$(curl -fsSL https://s3.amazonaws.com/tools.nanobox.io/bootstrap/ci.sh)"
- nanobox deploy

这给出了以下错误
+ nanobox deploy
Failed to validate provider - missing docker - exec: "docker": executable file not found in $PATH
Using nanobox with native requires tools that appear to not be available on your system.
docker
View these requirements at docs.nanobox.io/install

然后,我跟随 this page并更改了倒数第二行,如下所示
sudo bash -c "$(curl -fsSL https://s3.amazonaws.com/tools.nanobox.io/bootstrap/ci.sh)"

完成后,我得到以下错误
+ sudo bash -c "$(curl -fsSL https://s3.amazonaws.com/tools.nanobox.io/bootstrap/ci.sh)"
bash: sudo: command not found

我在这里没有花样,也没有这方面的经验。很感谢任何形式的帮助。

最佳答案

首先,您不能在管道中使用sudo,但这可能与此处无关。问题是nanobox cli无法执行未安装的docker。您应该为您的步骤启用docker服务。

image: php:7.1.29

pipelines:
branches:
staging:
- step:
name: Publish to staging version
deployment: staging

# Enable docker service
services:
- docker
caches:
- composer
script:
- docker version

您可能也不想看管道文档: Run Docker commands in Bitbucket Pipelines

关于docker - 如何运行Bitbucket管道在Nanobox上部署基于PHP的应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58318733/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com