8

実行すると、appengine で次のエラーが発生しますgcloud preview app run app.yamlThe --custom_entrypoint flag must be set for custom runtimes

app.yamlのように見えます:

version: 0-1-1
runtime: custom
vm: true
api_version: 1
manual_scaling:
  instances: 1

handlers:
  - url: .*
    script: dynamic

私のdockerfileは次のとおりです。 FROM google/nodejs-runtime

最新バージョンを取得するために再インストールgcloudしましたが、マネージド VM の yaml 構成で何か変更がありましたか? これにより、アプリをテストできなくなります。

4

3 に答える 3

4

runを実行gcloud help preview app runすると、run コマンドとそのパラメーターを説明する man ページを表示できます。--custom-entrypointは次のように説明されています。

 --custom-entrypoint CUSTOM_ENTRYPOINT
    Specify an entrypoint for custom runtime modules. This is required when
    such modules are present. Include "{port}" in the string (without
    quotes) to pass the port number in as an argument. For instance:
    --custom_entrypoint="gunicorn -b localhost:{port} mymodule:application"

エラー メッセージには--custom_entrypointアンダースコア付きの が表示されますが、パラメータは--customer_entrypointダッシュ付きの であることに注意してください。正しい名前は--custom-entrypoint次を参照してください: https://code.google.com/p/google-cloud-sdk/issues/detail?id=191

nodejs の場合、次のようなものを使用できるはずです。

gcloud preview app run app.yaml --project=your-project-id --custom-entrypoint "node index.js {port}"

アプリケーションの起動方法によって異なります。ポートは環境変数 PORT としても利用できるようですので{port}、アプリがコマンドライン引数を処理しない場合は使用する必要はありません。

しかし、私は使用npm startすることができませんでした。npm run <script>--custom-entrypoint

于 2015-08-05T07:50:24.157 に答える
0

のコメント行 391 ~ 397

google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py

#      if (self._module_configuration.effective_runtime == 'custom' and
#          os.environ.get('GAE_LOCAL_VM_RUNTIME') != '0'):
#        if not self._custom_config.custom_entrypoint:
#          raise ValueError('The --custom_entrypoint flag must be set for '
#                           'custom runtimes')
#        else:
#          runtime_config.custom_config.CopyFrom(self._custom_config)
于 2015-07-08T18:35:33.947 に答える