在我的机器上设置 Google Cloud 的托管虚拟机环境时出错。这是我调用命令的方式:
$ gcloud preview app setup-managed-vms
Select the runtime to download the base image for:
[1] Java
[2] Python27
[3] Go
[4] All
Please enter your numeric choice (4): 2
Pulling base images for runtimes [python27] from Google Cloud Storage
Pulling image: google/appengine-python27
Traceback (most recent call last):
File "/home/tuxdna/software/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 175, in <module>
main()
File "/home/tuxdna/software/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 171, in main
_cli.Execute()
File "/home/tuxdna/software/google-cloud-sdk/./lib/googlecloudsdk/calliope/cli.py", line 385, in Execute
post_run_hooks=self.__post_run_hooks, kwargs=kwargs)
File "/home/tuxdna/software/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 "/home/tuxdna/software/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 928, in Run
result = command_instance.Run(args)
File "/home/tuxdna/software/google-cloud-sdk/lib/googlecloudsdk/appengine/app_commands/setup_managed_vms.py", line 39, in Run
args.image_version)
File "/home/tuxdna/software/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/images/pull.py", line 54, in PullBaseDockerImages
util.PullSpecifiedImages(docker_client, image_names, version, bucket)
File "/home/tuxdna/software/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/images/util.py", line 232, in PullSpecifiedImages
'Error pulling {image}: {e}'.format(image=image_name, e=e))
googlecloudsdk.appengine.lib.images.util.DockerPullError: Error pulling google/appengine-python27: 500 Server Error: Internal Server Error ("Invalid registry endpoint https://localhost:49154/v1/: Get https://localhost:49154/v1/_ping: read tcp 127.0.0.1:49154: connection reset by peer. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry localhost:49154` 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/localhost:49154/ca.crt")
在服务器日志中,我看到:
$ tail -f /var/log/messages
....OUTPUT SKIPPED....
Dec 6 01:02:40 localhost docker: [error] server.go:1207 Handler for POST /images/create returned error: Invalid registry endpoint https://localhost:49154/v1/: Get https://localhost:49154/v1/_ping: read tcp 127.0.0.1:49154: connection reset by peer. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry localhost:49154` 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/localhost:49154/ca.crt
Dec 6 01:02:40 localhost docker: [error] server.go:110 HTTP Error: statusCode=500 Invalid registry endpoint https://localhost:49154/v1/: Get https://localhost:49154/v1/_ping: read tcp 127.0.0.1:49154: connection reset by peer. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry localhost:49154` 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/localhost:49154/ca.crt
Dec 6 01:02:40 localhost docker: [info] POST /v1.10/containers/3581906e323a639e634961795e2877cf8afd5431f09db5962c9b10a825363605/kill
....OUTPUT SKIPPED....
现在关于机器/docker 设置,我在 Fedora 20 上设置了 Docker,如下所示:
$ docker --tlsverify -H tcp://localhost:4243 info
Containers: 14
Images: 91
Storage Driver: devicemapper
Pool Name: docker-253:1-1704138-pool
Pool Blocksize: 65.54 kB
Data file: /var/lib/docker/devicemapper/devicemapper/data
Metadata file: /var/lib/docker/devicemapper/devicemapper/metadata
Data Space Used: 3.783 GB
Data Space Total: 107.4 GB
Metadata Space Used: 6.14 MB
Metadata Space Total: 2.147 GB
Library Version: 1.02.85 (2014-04-10)
Execution Driver: native-0.2
Kernel Version: 3.17.3-200.fc20.x86_64
Operating System: Fedora 20 (Heisenbug)
我还按照此处所述设置了 TLS:
所以现在我可以这样做:
$ docker --tlsverify -H tcp://localhost:4243 images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
gcloud-credentials-image latest a8e7cda4c92c 13 hours ago 2.434 MB
ubuntu 14.04 86ce37374f40 9 days ago 192.7 MB
fedora latest 7d3f07f8de5f 9 weeks ago 374.1 MB
$ docker --tlsverify -H tcp://localhost:4243 ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9fbb4918103b google/docker-registry:latest "/bin/sh -c 'cd /doc 13 hours ago Exited (-1) 13 hours ago jovial_nobel
48b994c1bfb0 gcloud-credentials-image:latest "/true" 13 hours ago Exited (0) 13 hours ago gcloud-credentials-1417757452.28
25c1be92b411 google/docker-registry:latest "/bin/sh -c 'cd /doc 14 hours ago Exited (0) 14 hours ago pensive_heisenberg
我在这里做错了什么?
提前致谢。