简体   繁体   English

在Windows上设置Docker时出错

[英]Error setting up docker on Windows

I am trying to set up docker machine on Windows and this problem has annoyed me for a few days. 我试图在Windows上设置docker机器,这个问题困扰了我几天。

I downloaded and installed DockerToolbox-1.9.1a on my Windows, so it came with Virtual Box version 5.0.10. 我在Windows上下载并安装了DockerToolbox-1.9.1a,因此Virtual Box版本为5.0.10。 After that I ran this command to create my virtual machine: 之后,我运行以下命令来创建我的虚拟机:

docker-machine create --driver virtualbox --engine-insecure-registry docker.pre-prod.ss.local:5000 --virtualbox-hostonly-cidr 192.168.99.100/24 mymachine docker-machine创建--driver virtualbox --engine-insecure-registry docker.pre-prod.ss.local:5000 --virtualbox-hostonly-cidr 192.168.99.100/24 mymachine

Here is what I got: 这是我得到的:

Waiting for machine to be running, this may take a few minutes... Machine is running, waiting for SSH to be available... Detecting operating system of created instance... Detecting the provisioner... Provisioning created instance... Copying certs to the local machine directory... Copying certs to the remote machine... Setting Docker configuration on the remote daemon... WARNING >>> This machine has been allocated an IP address, but Docker Machine could not reach it successfully. 等待机器运行,这可能需要几分钟的时间...计算机正在运行,等待SSH可用...正在检测创建的​​实例的操作系统...正在检测供应者...正在供应创建的实例...正在将证书复制到本地计算机目录...正在将证书复制到远程计算机...在远程守护程序上设置Docker配置...警告>>>该计算机已分配了IP地址,但Docker Machine无法成功访问它。

SSH for the machine should still work, but connecting to exposed ports, such as the Docker daemon port (usually :2376), may not work properly. 机器的SSH应该仍然可以正常工作,但是连接到裸露的端口(例如Docker守护程序端口(通常为:2376))可能无法正常工作。

You may need to add the route manually, or use another related workaround 您可能需要手动添加路线,或使用其他相关的解决方法

This could be due to a VPN, proxy, or host file configuration issue. 这可能是由于VPN,代理或主机文件配置问题。

You also might want to clear any VirtualBox host only interfaces you are not using 您可能还想清除所有不使用的VirtualBox主机专用接口

The machine was created successfully. 机器创建成功。 So I ran the docker-machine env command: 所以我运行了docker-machine env命令:

docker-machine env --shell=powershell mymachine| docker-machine env --shell = powershell mymachine | Invoke-Expression 调用表达

and I got: 我得到:

Error running connection boilerplate: Error checking and/or regenerating the certs: There was icates for host "192.168.99.100:2376": dial tcp 192.168.99.100:2376: connectex: No connection target machine actively refused it. 运行连接样板时出错:检查和/或重新生成证书时出错:主机“ 192.168.99.100:2376”有一个标识:拨号tcp 192.168.99.100:2376:connectex:没有连接目标计算机主动拒绝它。 You can attempt to regenerate them using 'docker-machine regenerate-certs name'. 您可以尝试使用“ docker-machine regenerate-certs name”来重新生成它们。 Be advised that this will trigger a Docker daemon restart which will stop running containers. 请注意,这将触发Docker守护程序重新启动,这将停止运行容器。

Running docker version returned 返回运行中的docker版本

Client: Version: 1.9.1 API version: 1.21 Go version: 客户端:版本:1.9.1 API版本:1.21 Go版本:
go1.4.3 Git commit: a34a1d5 Built: Fri Nov 20 17:56:04 UTC 2015 OS/Arch: windows/amd64 An error occurred trying to connect: Get http://localhost:2375/v1.21/version : dial tcp connection could be made because the target machine actively refused it. go1.4.3 Git提交:a34a1d5内置:Fri Nov 20 17:56:04 UTC 2015 OS / Arch:windows / amd64尝试连接时发生错误:获取http:// localhost:2375 / v1.21 / version :拨打tcp可以建立连接,因为目标计算机主动拒绝了它。

Can someone help to point out the direction to fix this issue? 有人可以帮忙指出解决此问题的方向吗? It is really troublesome to set up docker on Windows. 在Windows上设置docker确实很麻烦。 Thank you very much. 非常感谢你。

I use docker 1.9.1 on Windows (7, 8 and even 10), but without docker registry, and without using --virtualbox-hostonly-cidr . 我在Windows(7、8甚至10)上使用--virtualbox-hostonly-cidr 1.9.1,但没有--virtualbox-hostonly-cidr ,也没有使用--virtualbox-hostonly-cidr

If you are to use that last option, check " Set a specific address ip when i create a docker container ", where I mention issue 1709, which uses cidr in .1 , not .100 (but getting a .100 ip address as a result): 如果要使用最后一个选项,请选中“ 在创建docker容器时设置特定的IP地址 ”,在此我提到问题1709,它在.1中使用cidr,而不是.100 (但将.100 IP地址作为结果):

docker-machine create -d virtualbox --virtualbox-hostonly-cidr "192.168.99.1/24" m99

If there's no other machine with the same cidr (Classless Inter-Domain Routing) , the machine should always get the .100 IP upon start. 如果没有其他计算机具有相同的cidr(无类域间路由) ,则该计算机在启动时应始终获得.100 IP。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM