我正在尝试在Ubuntu 22.04 jammy上本地运行AWS Lambda项目。但是,当我使用AWS SAM Local执行项目时,会显示此错误。错误:在本地运行AWS SAM项目需要Docker。你安装好了吗?“
我安装并运行了SAM CLI版本1.79.0和Docker Desktop
我试着跟踪these steps,但两者都是:“sudo sam local start-api”和“sam local invoke HelloWorldFunction”给出了这个错误
我正在尝试在Ubuntu 22.04 jammy上本地运行AWS Lambda项目。但是,当我使用AWS SAM Local执行项目时,会显示此错误。错误:在本地运行AWS SAM项目需要Docker。你安装好了吗?“
我安装并运行了SAM CLI版本1.79.0和Docker Desktop
我试着跟踪these steps,但两者都是:“sudo sam local start-api”和“sam local invoke HelloWorldFunction”给出了这个错误
1条答案
按热度按时间yyhrrdl81#
我在Ubuntu 22.04和Budgie Desktop 10.6.1- 1ubuntu 3中遇到了同样的问题。SAM版本1.82,并尝试使用Docker桌面版本4.15和4.19。我也得到了
sam build
命令中提到的相同错误。我确实注意到,如果我完全安装docker并停在那里,SAM CLI似乎可以工作。(注意:我确实将.docker/config.json“credsStore”更改为“credStore”,但我不知道这是否是它工作的原因。)只有当我安装docker desktop时,我才再次收到此错误。
我试过在default和desktop-linux之间切换
docker context
,但没有成功。还要注意,我确实创建了docker组,并且我的用户是其中的一部分。是的,Docker确实在运行。虽然这不一定是答案,但我希望更多的信息是有帮助的!
我在下面附上了
sam build
的调试日志: