【问题标题】:Google Cloud Run Second Flask Application - requirements.txt issueGoogle Cloud Run Second Flask 应用程序 - requirements.txt 问题
【发布时间】:2022-11-26 13:58:20
【问题描述】:

我有一个名为“HelloWorld1”的 google cloud run flask 应用程序已经启动并正在运行,但是我需要创建第二个 flask 应用程序。我按照文档执行了以下步骤: 1- 在“Cloud Shell Editor”上点击“<>Cloud Code” --> “New Application” --> “Cloud Run Application Basic Cloud Run Application ..”-->“Python (Flask): Cloud Run”,提供并创建新的文件夹和应用程序。

2- 当我尝试使用“Run on Cloud Run Emulator”运行它时,出现以下错误:

Starting to run the app using configuration 'Cloud Run: Run/Debug Locally' from .vscode/launch.json...
To view more detailed logs, go to Output channel : "Cloud Run: Run/Debug Locally - Detailed"
Dependency check started
Dependency check succeeded
Starting minikube, this may take a while...................................
minikube successfully started
The minikube profile 'cloud-run-dev-internal' has been scheduled to stop automatically after exiting Cloud Code. To disable this on future deployments, set autoStop to false in your launch configuration /home/mian/newapp/.vscode/launch.json
Update initiated
Update failed with error code DEVINIT_REGISTER_BUILD_DEPS
listing files: file pattern [requirements.txt] must match at least one file
Skaffold exited with code 1.
Cleaning up...
Finished clean up.

我试过以下:

1- 尝试创建不同类型的应用程序,例如 django 而不是 flask,但总是出现相同的错误 2- 试图在 docker 设置中提供 [requirements.txt] 的完整路径,但没有成功。

请有人帮助我理解为什么由于这个错误我无法运行第二个云运行 Flask 应用程序?

【问题讨论】:

    标签: python-3.x flask minikube google-cloud-run cloud-run-emulator


    【解决方案1】:

    您的 Dockerfile 可能引用了“requirements.txt”文件,但该文件不在您的本地目录中。所以,它给出了它丢失的错误:

    列出文件:文件模式 [requirements.txt] 必须至少匹配一个文件

    【讨论】:

      猜你喜欢
      • 2021-06-12
      • 2021-12-05
      • 2022-08-14
      • 2020-05-28
      • 2021-12-25
      • 1970-01-01
      • 2021-01-09
      • 1970-01-01
      • 2023-02-07
      相关资源
      最近更新 更多