如何在Mac OSX上将USB无线接口连接到Docker容器?

我有一个需要无线接口工作的Linux Docker容器。 在Linux上(在Linux主机上运行它)我没有问题。 运行Docker容器的参数 – --privileged和 – --net=host我可以访问主机无线接口,我可以pipe理他们没有任何问题。 问题是当我在Mac OSX主机上运行相同的Linux Docker容器时。 我看不到Docker容器内的无线接口。

这是Mac OSX Sierra主机上ifconfig的输出:

 lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384 options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP> inet 127.0.0.1 netmask 0xff000000 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 nd6 options=201<PERFORMNUD,DAD> gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280 stf0: flags=0<> mtu 1280 en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 options=b<RXCSUM,TXCSUM,VLAN_HWTAGGING> ether 00:0c:29:fe:78:07 inet6 fe80::8ff:62ac:e141:5aa9%en0 prefixlen 64 secured scopeid 0x4 inet 192.168.0.153 netmask 0xffffff00 broadcast 192.168.0.255 nd6 options=201<PERFORMNUD,DAD> media: autoselect (1000baseT <full-duplex>) status: active en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 ether 00:c0:ca:5a:00:f2 nd6 options=201<PERFORMNUD,DAD> media: autoselect (<unknown type>) status: inactive utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000 inet6 fe80::7a12:53b9:61c3:3c7%utun0 prefixlen 64 scopeid 0x6 nd6 options=201<PERFORMNUD,DAD> 

“en1”接口是无线USB设备。 现在容器中的ifconfig输出使用所描述的参数运行:

 docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 inet 172.17.0.1 netmask 255.255.0.0 broadcast 0.0.0.0 ether 02:42:67:b5:aa:36 txqueuelen 0 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.65.2 netmask 255.255.255.248 broadcast 192.168.65.7 inet6 fe80::b564:23a5:1418:8f2a prefixlen 64 scopeid 0x20<link> ether c0:ff:ee:c0:ff:ee txqueuelen 1000 (Ethernet) RX packets 22 bytes 2418 (2.3 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 33 bytes 3100 (3.0 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1 (Local Loopback) RX packets 3 bytes 54 (54.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 3 bytes 54 (54.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 

我猜容器的eth0被“映射”到en0接口并正在工作,我在容器内部有互联网访问。 但是,为什么我没有看到en1映射到容器上的任何设备? 如何在Mac OSX上实现这一点? 如果我--net=host删除了--net=host以启动Docker,则docker0接口在容器内消失…是区别的,但无线接口在任何情况下都不会出现。