I am trying to run an AWS Lambda project locally on Ubuntu. When I run the project with AWS SAM Local it shows me this error: Error: Running AWS SAM projects locally requires Docker. Have you got it installed?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
I had trouble installing it on Fedora.
When I followed the Docker postinstall instructions I managed to get past this issue.
https://docs.docker.com/install/linux/linux-postinstall/
I had to:
- Delete the ~/.docker directory;
- Create the "docker" group;
- Add my user to the "docker" group;
- Logout and back in again;
- Restart the "docker" daemon.
I was then able to run the command:
sam local start-api
回答2:
We are working on Mac and were seeing same message when using an older version of Docker (1.12.6). Have since updated to a newer (but not latest) version 17.12.0-ce-mac49 and it is now fine.
回答3:
If you want to run local sam-cli
, you have first install docker from docker official website then run sudo sam local start-api
. Note that sudo is necessary for running local developer with needed privileges.