gcloud部署错误:找不到标记为google/docker-registry的图片

kan*_*nix 4 google-app-engine

我正在尝试使用此命令部署此项目https://github.com/GoogleCloudPlatform/appengine-nodejs-quickstart

gcloud --project poised-graph-758 preview app deploy --server preview.appengine.google.com .
Run Code Online (Sandbox Code Playgroud)

但我得到这个错误:

Updating module [default] from file [/Users/kannix/Desktop/tmp/appengine-nodejs-quickstart/app.yaml]
11:36 PM Host: preview.appengine.google.com
{bucket: vm-containers.poised-graph-758.appspot.com, path: /containers}

Traceback (most recent call last):
  File "/Users/kannix/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 153, in <module>
    main()
  File "/Users/kannix/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 149, in main
    _cli.Execute()
  File "/Users/kannix/google-cloud-sdk/./lib/googlecloudsdk/calliope/cli.py", line 381, in Execute
    post_run_hooks=self.__post_run_hooks, kwargs=kwargs)
  File "/Users/kannix/google-cloud-sdk/./lib/googlecloudsdk/calliope/frontend.py", line 274, in _Execute
    pre_run_hooks=pre_run_hooks, post_run_hooks=post_run_hooks)
  File "/Users/kannix/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 887, in Run
    result = command_instance.Run(args)
  File "/Users/kannix/google-cloud-sdk/./lib/googlecloudsdk/calliope/exceptions.py", line 78, in TryFunc
    return func(*args, **kwargs)
  File "/Users/kannix/google-cloud-sdk/lib/googlecloudsdk/appengine/app_commands/deploy.py", line 154, in Run
    self.__Run(args, project, deployables)
  File "/Users/kannix/google-cloud-sdk/lib/googlecloudsdk/appengine/app_commands/deploy.py", line 207, in __Run
    info.runtime, path, bucket)
  File "/Users/kannix/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/images/push.py", line 134, in BuildAndPushDockerImage
    boto_path=config.BOTO_PATH)) as r:
  File "/Users/kannix/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/images/registry.py", line 148, in __enter__
    self.Start()
  File "/Users/kannix/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/images/registry.py", line 97, in Start
    self._registry.Start()
  File "/Users/kannix/google-cloud-sdk/platform/google_appengine/google/appengine/tools/docker/containers.py", line 480, in Start
    self._image.Build()
  File "/Users/kannix/google-cloud-sdk/platform/google_appengine/google/appengine/tools/docker/containers.py", line 309, in Build
    raise ImageError('Image with tag %s was not found' % self.tag)
google.appengine.tools.docker.containers.ImageError: Image with tag google/docker-registry was not found
Run Code Online (Sandbox Code Playgroud)

我试图省略--server preview.appengine.google.com参数,但它会导致相同的错误

yus*_*ufm 6

您需要提取google/docker-registry图像以解决此错误:

docker pull google/docker-registry
Run Code Online (Sandbox Code Playgroud)

注意:如果在尝试重新部署时收到以下错误:

docker.docker.errors.APIError: 500 Server Error: Internal Server Error ("Invalid registry endpoint https://192.168.59.103:49153/v1/: Get https://192.168.59.103:49153/v1/_ping: EOF. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry 192.168.59.103:49153` to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/192.168.59.103:49153/ca.crt")
Run Code Online (Sandbox Code Playgroud)

确保已使用"insecure registry"选项设置docker守护程序(在执行以下步骤后,您需要重新启动google/docker-registry).您可以使用以下内容执行此操作(这是https://github.com/docker/docker/issues/8887上的答案):

$ boot2docker delete #removes old image
$ rm -f ~/.ssh/id_boot2docker* # remove old keys
$ boot2docker init #generates new keys, cert
$ boot2docker up
$ boot2docker ssh
$ # add EXTRA_ARGS="--insecure-registry <YOUR INSECURE HOST>" 
$ # to /var/lib/boot2docker/profile
$ sudo /etc/init.d/docker restart
Run Code Online (Sandbox Code Playgroud)