[英]AWS SAM Python debug on Mac M1 (Apple Silicon)
I'm currently working with AWS Lambdas functions with Python code.我目前正在使用带有 Python 代码的 AWS Lambdas 函数。 There is an interesting feature while working with them that allows users to debug Lambda functions locally.使用它们时有一个有趣的功能,允许用户在本地调试 Lambda 函数。
When debugging locally the function is ran within a docker image.在本地调试时,该函数在 docker 映像中运行。 While trying to build images in M1 Mac I always have problems.在尝试在 M1 Mac 中构建图像时,我总是遇到问题。
I'm currently trying to debug the Python Lambda function and got this error:我目前正在尝试调试 Python Lambda 函数并收到此错误:
Validate Docker has failed: Cannot run program "docker": error=2, No such file or directory7 has failed: Cannot run program "docker": error=2, No such file or directory
Probably it is related to ARM64 architecture and Docker.可能与ARM64架构和Docker有关。
Anyone knows any workaround in order to debug Python Lambdas locally in Mac M1?任何人都知道在 Mac M1 中本地调试 Python Lambda 的任何解决方法吗?
Solved :已解决:
The error was because I had installed Docker for Mac Intel version.错误是因为我安装了 Docker for Mac Intel 版本。
Install Docker with steps recommended by the documentation in this link.使用此链接中的文档推荐的步骤安装 Docker。 Be sure that you are installing the Apple Silicon version.确保您安装的是 Apple Silicon 版本。
Also before installing it, it is recommended to install Rosseta 2 in your Mac M1 Apple Silicon.同样在安装之前,建议在您的 Mac M1 Apple Silicon 中安装 Rosseta 2。
$ softwareupdate --install-rosetta
Also in this page there are some common issues and troubleshoots for Docker in Mac M1 Apple Silicon.此外,在此页面中,还有一些针对 Mac M1 Apple Silicon 中的 Docker 的常见问题和故障排除。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.