在GCE

时间:2016-10-17 17:59:05

标签: docker docker-machine google-compute-engine

尝试从我的机​​器上在GCE上创建泊坞机时,会出现以下错误:

$ docker-machine create --driver google \
    --google-project $PROJECT_ID \
    --google-zone $GOOGLE_ZONE \
    --google-machine-type $GOOGLE_MACHINE_TYPE \
    test-docker-machine
Running pre-create checks...
(test-docker-machine) Check that the project exists
(test-docker-machine)) Check if the instance already exists
Creating machine...
(test-docker-machine) Generating SSH Key
(test-docker-machine) Creating host...
(test-docker-machine) Opening firewall ports
(test-docker-machine) Creating instance
(test-docker-machine) Waiting for Instance
(test-docker-machine) Uploading SSH Key
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with ubuntu(systemd)...
Installing Docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Error creating machine: Error checking the host: Error checking and/or regenerating the certs: There was an error validating certificates for host "104.199.63.145:2376": dial tcp 104.199.63.145:2376: i/o timeout
You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.
Be advised that this will trigger a Docker daemon restart which will stop running containers.

我尝试按照建议使用docker-machine regenerate-certs测试,但它似乎没有改正:

$ docker-machine regenerate-certs test-docker-machine
Regenerate TLS machine certs? Warning: this is irreversible. (y/n): y
Regenerating TLS certificates
Waiting for SSH to be available...
Detecting the provisioner...
Installing Docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...

$ docker-machine env test-docker-machine
Error checking TLS connection: Error checking and/or regenerating the certs: There was an error validating certificates for host "104.199.63.145:2376": dial tcp 104.199.63.145:2376: i/o timeout
You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.
Be advised that this will trigger a Docker daemon restart which will stop running containers.

此外,“docker-machine ls”显示机器的“超时”状态,但与“docker-machine ssh test-docker-machine”的ssh连接正常工作。

你能帮我解决这个问题吗?

以下是我的安装细节:

$ docker-machine version
docker-machine version 0.8.2, build e18a919

$ docker version
Client:
Version: 1.11.0
API version: 1.23
Go version: go1.5.4
Git commit: 4dc5990
Built: Wed Apr 13 18:40:36 2016
OS/Arch: linux/amd64

Server:
Version: 1.11.0
API version: 1.23
Go version: go1.5.4
Git commit: 4dc5990
Built: Wed Apr 13 18:40:36 2016
OS/Arch: linux/amd64

最后提示:当我从GCE主机尝试相同时,它完美地工作......

2 个答案:

答案 0 :(得分:1)

正如@NateQ所建议的那样,解决方案是使用最新的Ubuntu映像,使用最新的Ubuntu映像对docker-machine默认的google映像(ubuntu-1510-wily-v20151114,如doc:https://docs.docker.com/machine/drivers/gce/中的精确度)进行附加费用。 :

--google-machine-image https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/
ubuntu-1604-xenial-v20161205
“docker-machine”命令行中的

选项

答案 1 :(得分:0)

在我的情况下,配置了错误的仅主机网络连接。禁用新的连接并重新启用旧连接并在virtualbox上重新配置boot2docker VM以解决问题。 因此,谷歌虚拟机上的YMMV。