Google Cloud SDK在Mac OS上无法启动Docker镜像的预览。

huangapple go评论101阅读模式
英文:

Google cloud sdks doesn't start preview for Docker image Mac OS

问题

我的app.yaml文件:

runtime: custom
vm: true
api_version: 1
health_check:
  enable_health_check: False

Dockerfile文件:

# 使用基于debian构建的官方go docker镜像。
FROM golang:1.5.1

# 获取源代码并将其添加到工作空间。
ADD . /go/

# 安装revel和revel CLI。
RUN go get github.com/revel/revel
RUN go get github.com/revel/cmd/revel

# 使用revel CLI启动我们的应用程序。
ENTRYPOINT revel run 4quorum-appengine dev 8080

# 打开应用程序运行的端口。
EXPOSE 8080

我正在按照这篇文章进行操作:
http://jbeckwith.com/2015/05/08/docker-revel-appengine/

预览

我正在尝试预览它:

gcloud preview app run app.yaml --custom-entrypoint "revel run 4quorum-appengine dev 8080"
警告:`app run`命令已被弃用,并将很快被删除。

请改用dev_appserver.py(与`gcloud`命令在同一目录中)。
模块[default]在文件[/Users/802619/Projects/src/4quorum_root/app.yaml]中找到
INFO:正在查找位于[/Users/802619/Projects/src/4quorum_root]的Dockerfile
INFO:正在使用位于[/Users/802619/Projects/src/4quorum_root]的Dockerfile
INFO     2015-11-06 18:03:44,226 application_configuration.py:399] 未指定版本。生成的版本ID:20151106t180344
INFO     2015-11-06 18:03:44,226 devappserver2.py:763] 跳过SDK更新检查。
INFO     2015-11-06 18:03:44,266 api_server.py:205] 在http://localhost:62780启动API服务器
INFO     2015-11-06 18:03:44,272 dispatcher.py:197] 在http://localhost:8080启动模块"default"
INFO     2015-11-06 18:03:44,277 admin_server.py:116] 在http://localhost:8000启动管理服务器
ERROR    2015-11-06 18:03:44,282 instance.py:280] [Errno 2] 没有该文件或目录

如果尝试dev_appserver.py也是同样的情况

部署

部署也无法工作。由于超时而失败。

gcloud preview app deploy ./app.yaml
警告:即将,默认情况下,部署将设置已部署版本以接收所有流量。

要保持当前行为(新部署不接收任何流量),请使用`--no-promote`标志或运行以下命令:

  $ gcloud config set app/promote_by_default false

 要提前采用新行为,请使用`--promote`标志或运行以下命令:

  $ gcloud config set app/promote_by_default true

  通过传递新标志之一或设置这些属性之一,将消除此消息。

 您即将部署以下模块:
 - vaulted-gift-112113/default(来自[/Users/802619/Projects/src/4quorum_root/app.yaml])
       部署的URL:[https://20151106t204027-dot-vaulted-gift-112113.appspot.com]
 (如果您还希望从[https://vaulted-gift-112113.appspot.com]访问此模块,请添加--promote)

开始部署...
验证已启用并准备好托管VM。

提供远程构建服务。
复制用于安全访问的证书。您可能会提示创建SSH密钥对。
为模块[default]构建和推送镜像
将[.dockerignore]保存到[/Users/802619/Projects/src/4quorum_root]。
----------------------------- DOCKER BUILD OUTPUT ------------------------------
步骤0:FROM golang:1.5.1
---> f6271e8f3723
步骤1:ADD . /go/
---> 94fafc5e8a30
删除中间容器cfbe197f6e93
步骤2:RUN go get github.com/revel/revel
---> 正在运行d7ad8c923144
---> b65877cf3049
删除中间容器d7ad8c923144
步骤3:RUN go get github.com/revel/cmd/revel
---> 正在运行2a9b3320ce47
---> 428defd008f3
删除中间容器2a9b3320ce47
步骤4:ENTRYPOINT revel run 4quorum-appengine dev 8080
---> 正在运行8b9e38ec69ec
---> 3749ee8a6636
删除中间容器8b9e38ec69ec
步骤5:EXPOSE 8080
---> 正在运行a0e6c66b56c8
---> dafff62b9643
删除中间容器a0e6c66b56c8
成功构建dafff62b9643
--------------------------------------------------------------------------------

将文件复制到Google Cloud Storage...
将文件同步到[gs://staging.vaulted-gift-112113.appspot.com/]。
更新模块[default]...|已删除[https://www.googleapis.com/compute/v1/projects/vaulted-gift-112113/zones/us-central1-f/instances/gae-builder-vm-20151106t204027]。
 更新模块[default]...失败。
错误:(gcloud.preview.app.deploy)错误响应:[4]超时创建VM。

即将放弃这个。

英文:

My app.yaml

runtime: custom
vm: true
api_version: 1
health_check:
  enable_health_check: False

Dockerfile

# Use the official go docker image built on debian.
FROM golang:1.5.1

# Grab the source code and add it to the workspace.
ADD . /go/

# Install revel and the revel CLI.
RUN go get github.com/revel/revel
RUN go get github.com/revel/cmd/revel

# Use the revel CLI to start up our application.
ENTRYPOINT revel run 4quorum-appengine dev 8080

# Open up the port where the app is running.
EXPOSE 8080

I was working through this article
http://jbeckwith.com/2015/05/08/docker-revel-appengine/

Preview

I am trying to preview it:

gcloud preview app run app.yaml --custom-entrypoint "revel run 4quorum-appengine dev 8080"
WARNING: The `app run` command is deprecated and will soon be removed.

Please use dev_appserver.py (in the same directory as the `gcloud` command) instead.
Module [default] found in file     [/Users/802619/Projects/src/4quorum_root/app.yaml]
INFO: Looking for the Dockerfile in     /Users/802619/Projects/src/4quorum_root
INFO: Using Dockerfile found in /Users/802619/Projects/src/4quorum_root
INFO     2015-11-06 18:03:44,226 application_configuration.py:399] No version specified. Generated version id: 20151106t180344
INFO     2015-11-06 18:03:44,226 devappserver2.py:763] Skipping SDK update check.
INFO     2015-11-06 18:03:44,266 api_server.py:205] Starting API server at: http://localhost:62780
INFO     2015-11-06 18:03:44,272 dispatcher.py:197] Starting module "default" running at: http://localhost:8080
INFO     2015-11-06 18:03:44,277 admin_server.py:116] Starting admin server at: http://localhost:8000
ERROR    2015-11-06 18:03:44,282 instance.py:280] [Errno 2] No such file or directory

The same thing if trying dev_appserver.py

Deploy

Deploy also doesn't work. Fails because of timeout.

gcloud preview app deploy ./app.yaml
WARNING: Soon, deployments will set the deployed version to receive all traffic by

default.

To keep the current behavior (where new deployments do not receive any traffic),
use the `--no-promote` flag or run the following command:

  $ gcloud config set app/promote_by_default false

 To adopt the new behavior early, use the `--promote` flag or run the     following
command:

  $ gcloud config set app/promote_by_default true

  Either passing one of the new flags or setting one of these properties will

silence this message.

 You are about to deploy the following modules:
 - vaulted-gift-112113/default (from   [/Users/802619/Projects/src/4quorum_root/app.yaml])
       Deployed URL: [https://20151106t204027-dot-vaulted-gift-      112113.appspot.com]
 (add --promote if you also want to make this module available from
 [https://vaulted-gift-112113.appspot.com])

Beginning deployment...
Verifying that Managed VMs are enabled and ready.

Provisioning remote build service.
Copying certificates for secure access. You may be prompted to create an SSH keypair.
Building and pushing image for module [default]
Saving [.dockerignore] to [/Users/802619/Projects/src/4quorum_root].
----------------------------- DOCKER BUILD OUTPUT ------------------------------
Step 0 : FROM golang:1.5.1
---> f6271e8f3723
Step 1 : ADD . /go/
---> 94fafc5e8a30
Removing intermediate container cfbe197f6e93
Step 2 : RUN go get github.com/revel/revel
---> Running in d7ad8c923144
---> b65877cf3049
Removing intermediate container d7ad8c923144
Step 3 : RUN go get github.com/revel/cmd/revel
---> Running in 2a9b3320ce47
---> 428defd008f3
Removing intermediate container 2a9b3320ce47
Step 4 : ENTRYPOINT revel run 4quorum-appengine dev 8080
---> Running in 8b9e38ec69ec
---> 3749ee8a6636
Removing intermediate container 8b9e38ec69ec
Step 5 : EXPOSE 8080
---> Running in a0e6c66b56c8
---> dafff62b9643
Removing intermediate container a0e6c66b56c8
Successfully built dafff62b9643
--------------------------------------------------------------------------------

Copying files to Google Cloud Storage...
Synchronizing files to [gs://staging.vaulted-gift-112113.appspot.com/].
Updating module [default]...|Deleted      [https://www.googleapis.com/compute/v1/projects/vaulted-gift-  112113/zones/us-central1-f/instances/gae-builder-vm-20151106t204027].
 Updating module [default]...failed.
ERROR: (gcloud.preview.app.deploy) Error Response: [4] Timed out creating VMs.

About to drop this.

答案1

得分: 0

迁移到了Heroku。Google App Engine还没有准备好。

英文:

Moved to heroku. Google App Engine is not ready yet.

huangapple
  • 本文由 发表于 2015年11月7日 02:18:51
  • 转载请务必保留本文链接:https://go.coder-hub.com/33573160.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定