使用docker-machine添加已经安装了Docker Engine的主机的问题

docker-machine可以在本地、远程SSH免密码登录的情况下安装Docker Engine, 我看有地方的文档还写着可以添加远程已经安装好Docker Engine的Docker Host, 准备工作如下: 本地主机主机名:Chris-Laptop,已安装docker-machine 远程主机主机名:li845-130,已安装docker engine 1). 远程Docker Host主机上的docker daemon进程运行情况: # <strong>ps -ef|grep docker | grep -v grep</strong> root 12093 1 0 02:09 ? 00:00:00 /usr/bin/docker daemon -H tcp://0.0.0.0:2376 2). 配置本地Docker Machine主机与远程Docker Engine ssh免密码登录; $ <strong>ssh root@139.162.3.130</strong> Last failed login: Mon Mar 21 02:54:06 UTC 2016 from 125.88.177.95 on ssh:notty There were 54 failed login attempts since the last successful login. Last login: Mon Mar 21 02:25:25 2016 from 114.248.235.223 # 在本地Docker Machine主机添加远程的Docker Host 1).命令如下: $ <strong>docker-machine create --driver none -url=tcp://139.162.3.130:2376 linodevps</strong> Running pre-create checks... Creating machine... To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env linodevps $ <strong>docker-machine ls</strong> NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS default * virtualbox Running tcp://192.168.99.100:2376 v1.10.3 linodevps - none Running tcp://139.162.3.130:2376 Unknown Unable to query docker version: Unable to read TLS config: open /Users/tdy218/.docker/machine/machines/linodevps/server.pem: no such file or directory $ $ <strong>docker-machine -D regenerate-certs linodevps</strong> Docker Machine Version: 0.6.0, build e27fb87 Regenerate TLS machine certs? Warning: this is irreversible. (y/n): y Regenerating TLS certificates Found binary path at /usr/local/bin/docker-machine Launching plugin server for driver none Plugin server listening at address 127.0.0.1:54648 () Calling .GetVersion Using API Version 1 () Calling .SetConfigRaw () Calling .GetMachineName command=configureAuth machine=linodevps Waiting for SSH to be available... Getting to WaitForSSH function... (linodevps) Calling .GetSSHHostname (linodevps) Calling .GetSSHPort (linodevps) Calling .GetSSHKeyPath (linodevps) Calling .GetSSHUsername Using SSH client type: external { /usr/bin/ssh} About to run SSH command: exit 0 SSH cmd err, output: exit status 255: usage: ssh [-D port] [-L port:host:hostport] [-R port:host:hostport] [-w local_tun] hostname Error getting ssh command 'exit 0' : Something went wrong running an SSH command! command : exit 0 err : exit status 255 output : usage: ssh [-D port] [-L port:host:hostport] [-R port:host:hostport] [-w local_tun] hostname 最后报Too many retries waiting for SSH to be available. Last error: Maximum number of retries (60) exceeded,问题是我已经配了docker-machine所在主机与docker host主机免密码ssh登录,怎么还卡在这里,无法生成SSL证书?
已邀请:
专程注册账号回到你的问题,现在docker repo里也报了很多issue和这个问题相关,我之前也一直没明白,后来发现大家都被误导了 --url 这个参数和导入已经存在的engine之间没有必然关系。 参见官方文档:https://docs.docker.com/machine/drivers/generic/ 里面有一句话很容易忽略:or if you would like to import an existing host to allow Docker Machine to manage. 其实这就表明导入已经存在的engine就应该和创建generic machine一样的命令。

要回复问题请先登录注册