gcloud 预览应用程序 运行 不会重新构建 docker 文件

gcloud preview app run doesn't re-build docker file

跟随managed VMs tutorial,我想运行本地一些后面的例子。 (就像我对 development/testing 所做的那样。)当我将我的项目部署到云端时,它工作得非常愉快,但是当我 运行 它在本地时 (gcloud preview app run ./app.yaml) 我收到一个导入错误,因为 flask 是未安装/docker 图像未更新。

有没有办法在本地构建和 运行 容器?

设置环境变量GAE_LOCAL_VM_RUNTIME0:

export GAE_LOCAL_VM_RUNTIME=0
gcloud preview app run app.yaml

此行为在 Cloud SDK RELEASE_NOTES 0.9.71 版中进行了描述:

For several months on the Managed VMs team we've been testing a new mode of dockerless local development on gcloud that makes developing a module for Python, Java and Go users similar to development of regular App Engine applications. This new mode relaxes the sandbox constraints present in the devappserver for vm: false applications, and does not require Docker to be installed.

You can currently opt-into this behavior by setting GAE_LOCAL_VM_RUNTIME=1; In this release of the Cloud SDK, we will be making this behavior the default for Managed VM users who are using gcloud.

You can still opt-out of this behavior by setting: GAE_LOCAL_VM_RUNTIME=0.