【发布时间】:2016-04-18 01:14:15
【问题描述】:
尝试将 Java 应用部署到 Google Appengine 托管虚拟机。我正在使用控制台gcloud 并且已经准备好WAR 文件。加上 app.yaml。
使用以下命令:
gcloud preview app deploy ./build/libs/app.yaml
现在它失败了:
Building and pushing image for module [default]
-------------------------------------------------------------------------------- DOCKER BUILD OUTPUT --------------------------------------------------------------------------------
Step 0 : FROM gcr.io/google_appengine/jetty9
---> 005014071b64
Step 1 : ADD webapp-webapp.war $JETTY_BASE/webapps/root.war
---> 3e9023930cc8
Removing intermediate container 342e8a2f5750
Successfully built 3e9023930cc8
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Beginning teardown of remote build environment (this may take a few seconds).
Updating module [default]...failed.
ERROR: (gcloud.preview.app.deploy) Error Response: [400] "env" setting is not supported for this deployment.
我看到maven-gcloud-plugin 的类似错误 (there) 在项目未配置为 WAR 时发生。但请注意:
- 我正在使用简单的命令行工具
gcloud,最新版本 - 并且我的项目已经打包到 WAR 中了
我也在使用以下app.yaml(我从 maven 插件源获得):
runtime: java
env: 2
api_version: 1
handlers:
- url: .*
script: dynamic
所以问题是,这个错误是从哪里来的(docker 镜像已经准备好了,对吧?)。这是什么意思?以及如何解决这个问题?
更新
我注意到它使用FROM gcr.io/google_appengine/jetty9 作为VM。但对于 Appengine,它应该是 FROM gcr.io/google_appengine/jetty9-compat。我尝试切换到 exploded app 而不是 WAR,并且它开始使用正确的 Docker 基础映像。但仍然失败:
Building and pushing image for module [default]
-------------------------------------------------------------------------------- DOCKER BUILD OUTPUT --------------------------------------------------------------------------------
Step 0 : FROM gcr.io/google_appengine/jetty9-compat
---> 2ad8572ef3d8
Step 1 : ADD . /app/
---> b10f4bc6718e
Removing intermediate container 8b149f4baf9c
Successfully built b10f4bc6718e
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Beginning teardown of remote build environment (this may take a few seconds).
Updating module [default]...failed.
ERROR: (gcloud.preview.app.deploy) Error Response: [400] "env" setting is not supported for this deployment.
【问题讨论】:
标签: java google-app-engine google-cloud-platform gcloud google-managed-vm