适用于Windows主机网络堆栈的Docker [英] Docker for Windows Host Network Stack Use

查看:51
本文介绍了适用于Windows主机网络堆栈的Docker的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我正在一个项目中,我们正在使用ROS,Bebop_autonomy和OpenCV来自动控制Parrot Bebop2.我们在工作区中使用的机器正在运行Ubuntu 14.04.5,我可以使用映像启动容器

Currently, I'm working on a project where we are using ROS, Bebop_autonomy, and OpenCV to control a Parrot Bebop2 autonomously. The machines we use in the workspace are running Ubuntu 14.04.5, and I can start a container using an image

我使用"docker run -it --network = host用户名/图像"创建.在配置完容器内的所有内容之后,bebop_autonomy节点就可以正常运行,并且可以在Bebop的网络上完美通信.当您在容器和主机中都运行ip addr时,它们显示的地址与您期望的相同.

I created with "docker run -it --network=host username/image". After configuring everything inside the container, the bebop_autonomy node is fine and can communicate on the Bebop's network perfectly. When you run ip addr in both the container and host machine, they show the same address, as you'd expect.

但是,当尝试在Windows计算机上运行它时,ip与主机不同,并且在与Bebop进行通信时我从未收到任何ACK数据包.我假设这是因为数据包没有被发送到正确的IP,或者它们没有被正确转发.

However, when trying to run it on my Windows machine, the ip is different than the host machine, and I'm never receiving any ACK packets when I try to communicate with the Bebop. I'm assuming this is because the packets aren't being sent to the right ip, or they aren't being forwarded correctly.

我尝试创建自己的网络,并使用"docker network create"手动设置ip并将其作为参数传递给run命令,但是我似乎根本无法使它正常工作.我也尝试过在Hyper-V管理器中创建不同的开关,但是最近几天我所读的任何内容都没有帮助我解决这个问题.

I have tried creating my own network and setting the ip manually with "docker network create" and passing it in to the run command as an argument, but I can't seem to get it to work at all. I've also tried creating different switches in the Hyper-V manager, but nothing I've read in the last few days has helped me figure this out.

我已经很好地了解了docker的工作原理,但是我看到的大多数参考资料都在谈论已经在运行linux的主机.如果我不知道这一点,那么对我们而言,首先继续使用docker几乎是没有用的.

I've got a good handle on how docker works, but most of the reference material I see is talking about a host that already runs linux. If I can't figure this out, it's almost useless for us to continue with docker in the first place.

在提供--network = host时,是否有任何方法可以将Windows的Docker配置为与Docker在Linux上的工作方式相同?

Is there any way to configure Docker for Windows to work in the same way that Docker works on Linux when providing --network=host?

推荐答案

通过在Hyper-V管理器中创建一个单独的网络,将该网络设置为仅使用外部wifi适配器,然后运行使用该网络的容器.不过,必须有更好的方法.

I ended up achieving what I wanted by creating a separate network in Hyper-V manager, setting that network to only use an external wifi-adapter, and running the container using that network. There has to be a better way though.

这篇关于适用于Windows主机网络堆栈的Docker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆