簡體   English   中英

在 GCE 中使用 docker-machine 時出現“錯誤驗證證書”

[英]“error validating certificates” when using docker-machine in GCE

嘗試從我的機​​器在 GCE 上創建 docker-machine 時,出現以下錯誤:

$ 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 主機嘗試相同的操作時,它運行良好...

正如@NateQ 所建議的那樣,解決方案是對 docker-machine 默認谷歌圖像(這是 ubuntu-1510-wily-v20151114,如文檔中所述: https ://docs.docker.com/machine/drivers/gce/ )進行額外收費使用最新的 Ubuntu 映像:

--google-machine-image https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/
ubuntu-1604-xenial-v20161205

“docker-machine”命令行中的選項

就我而言,這是配置錯誤的 Host-Only Network 連接。 禁用新連接並重新啟用舊連接並在 virtualbox 上重新配置 boot2docker VM 以解決問題。 相應地,谷歌虛擬機上的 YMMV。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM