Macos Can';t运行无服务器&;bref局部基本示例
我想运行一个基本的无服务器示例&bref示例 我所做的:Macos Can';t运行无服务器&;bref局部基本示例,macos,serverless,bref,Macos,Serverless,Bref,我想运行一个基本的无服务器示例&bref示例 我所做的: npm安装-g无服务器 作曲者需要bref/bref 供应商/bin/bref init 无服务器调用本地-f hello--docker 我发现这个错误: Miroslavs-MacBook-Air:testing kosta90s$ serverless invoke local -f hello --docker Serverless: Packaging service... Serverless: Excluding devel
Miroslavs-MacBook-Air:testing kosta90s$ serverless invoke local -f hello --docker
Serverless: Packaging service...
Serverless: Excluding development dependencies...
START RequestId: f815c369-8fa7-1671-cbbd-d623069bc9c2 Version: $LATEST
END RequestId: f815c369-8fa7-1671-cbbd-d623069bc9c2
REPORT RequestId: f815c369-8fa7-1671-cbbd-d623069bc9c2 Init Duration: 15.78 ms Duration: 1.35 ms Billed Duration: 100 ms Memory Size: 1024 MB Max Memory Used: 7 MB
{"errorType":"exitError","errorMessage":"RequestId: f815c369-8fa7-1671-cbbd-d623069bc9c2 Error: Couldn't find valid bootstrap(s): [/var/task/bootstrap /opt/bootstrap]"}
Error --------------------------------------------------
Error: Failed to run docker for provided image (exit code 1})
at /usr/local/lib/node_modules/serverless/lib/plugins/aws/invokeLocal/index.js:536:21
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com
Your Environment Information ---------------------------
Operating System: darwin
Node Version: 14.14.0
Framework Version: 2.8.0
Plugin Version: 4.1.1
SDK Version: 2.3.2
Components Version: 3.2.7
我在MacOs Catalina上工作。
serverless invoke local
尝试使用名为lambci/lambda:${runtime}
的Docker映像,其中runtime
是phpX.Y
这里没有您可以看到的图像:
正如评论所说,不要使用——docker
。如果您需要Docker,可以遵循并使用以下Docker compose.yml
:
version: "3.5"
services:
web:
image: bref/fpm-dev-gateway
ports:
- '8000:80'
volumes:
- .:/var/task
depends_on:
- php
environment:
HANDLER: index.php
php:
image: bref/php-74-fpm-dev
volumes:
- .:/var/task:ro
我对布雷夫不熟悉。但我认为你错加了“--docker”。您可以尝试在没有它的情况下调用函数吗?
version: "3.5"
services:
web:
image: bref/fpm-dev-gateway
ports:
- '8000:80'
volumes:
- .:/var/task
depends_on:
- php
environment:
HANDLER: index.php
php:
image: bref/php-74-fpm-dev
volumes:
- .:/var/task:ro