【发布时间】:2021-03-19 06:16:40
【问题描述】:
我正在尝试使用我的项目根文件夹中的以下命令使用 aws-sam-cli 测试我的 hello world lambda 函数:
sam local start-api --debug
这在控制台中给了我以下输出:
2018-07-11 16:13:15 local start-api command is called
2018-07-11 16:13:15 2 resources found in the template
2018-07-11 16:13:15 Found Serverless function with name='Hello' and CodeUri='.'
2018-07-11 16:13:15 Trying paths: ['/home/jamiro/.docker/config.json', '/home/jamiro/.dockercfg']
2018-07-11 16:13:15 No config file found
2018-07-11 16:13:15 Trying paths: ['/home/jamiro/.docker/config.json', '/home/jamiro/.dockercfg']
2018-07-11 16:13:15 No config file found
Error: Running AWS SAM projects locally requires Docker. Have you got it installed?
据我了解,我确实安装了 docker,因为执行 docker --version 会产生以下输出:
Docker version 18.03.1-ce, build 9ee9f40
有人知道为什么 sam 找不到 docker 吗?
【问题讨论】:
-
运行
which docker。它说 Docker 安装在哪里? -
它返回 /usr/bin/docker
-
可以this quiestion 帮助你吗?
-
@juanlumn 这似乎已经解决了,谢谢!当评论回答问题时,我不确定标准程序是什么。您是否将其作为单独的答案发布以便我接受?
-
刚刚添加了答案
标签: amazon-web-services docker aws-lambda aws-sam-cli