Google Cloud Functions 包含 Brew 依赖项

cro*_*999 2 python google-app-engine google-cloud-platform google-cloud-functions

由于 Google AppEngine 2.7 不允许使用 C lib 扩展的 3rd 方库,我一直在寻找替代方法来设置类似于 repo 中显示的后端:https : //github.com/jpf/okta- pysaml2-example。它基本上是 python 的 saml,将与我的 GAE 标准环境一起运行。

谷歌云功能似乎非常适合,但我看不到安装 Brew 依赖项的方法。这不可能吗?

Dus*_*ram 5

无法为 Cloud Functions 或 App Engine 标准环境(2.7 或 3.7)安装系统级依赖项。

相反,您需要创建一个 App Engine Flex 自定义运行时,并手动定义一个Dockerfile用于安装依赖项的代码,如下所示:

RUN apt-get install libffi-dev libxmlsec1 libssl-dev
Run Code Online (Sandbox Code Playgroud)

另请注意,App Engine 平台是 Ubuntu,因此您将使用apt包管理器,而不是brew(适用于 macOS)。