Running AWS SAM projects locally get error

放肆的年华 提交于 2020-01-13 08:32:26

问题


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:

  1. Delete the ~/.docker directory;
  2. Create the "docker" group;
  3. Add my user to the "docker" group;
  4. Logout and back in again;
  5. 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.



来源:https://stackoverflow.com/questions/50791354/running-aws-sam-projects-locally-get-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!