English 中文(简体)
为什么在码头集装箱返回(NUL)网络接口内进行ava流?
原标题:Why does running avahi-browse within a docker container returns (NULL) network interfaces?

I m 试图从Docker集装箱内发现mDNS并使用该集装箱进行操作

sudo docker run --privileged -v /var/run/dbus:/var/run/dbus -v /var/run/avahi-daemon/socket:/var/run/avahi-daemon/socket -d -p 5001:5001 my_application

https://stackoverflow.com/questions/30646943/how-to-avahi-browse- from-a-docker-container”>post/a。

在集装箱内运行瓦希河时,我获得这一产出:

root@38ca93e44ce1:/etc/avahi# avahi-browse -a
+ (null) IPv4 amzn.dmgr:2A9009CCFEAFDF82846897DD0D687295:xnVDMM+4u1:767308 Amazon Fire TV       local
+ (null) IPv6 Canon MG7700 series                           _uscan._tcp          local
+ (null) IPv4 Canon MG7700 series                           _uscan._tcp          local
+ (null) IPv6 Canon MG7700 series                           Secure Internet Printer local
+ (null) IPv4 Canon MG7700 series                           Secure Internet Printer local
+ (null) IPv6 Canon MG7700 series                           _scanner._tcp        local
+ (null) IPv4 Canon MG7700 series                           _scanner._tcp        local
+ (null) IPv6 Canon MG7700 series                           Internet Printer     local
+ (null) IPv4 Canon MG7700 series                           Internet Printer     local
+ (null) IPv6 Canon MG7700 series                           UNIX Printer         local
+ (null) IPv4 Canon MG7700 series                           UNIX Printer         local
+ (null) IPv4 Canon MG7700 series                           Web Site             local
+ (null) IPv4 Canon MG7700 series                           _canon-bjnp1._tcp    local
+ (null) IPv4 Canon MG7700 series                           _privet._tcp         local
+ (null) IPv6 Canon MG7700 series                           Web Site             local
+ (null) IPv6 Canon MG7700 series                           _canon-bjnp1._tcp    local
+ (null) IPv6 Canon MG7700 series                           _privet._tcp         local

I m 奇怪的是,网络接口栏为何显示(null)以及是否有办法显示适当的接口(wlan0, eth0, 等)。

问题回答

由于集装箱位于一个孤立的网络名称空间——它没有进入东道接口,因此,你重新看到网络接口的<代码>(null)。

可以通过在东道网络名称空间运行(--net=host,其中要求您放弃-p的选项),使集装箱能够进入东道网络环境,从而解决这个问题。

至少在我的测试中,运行一个<代码>-privileged。 这两种情况似乎都需要集装箱。





相关问题
Does log4net support zeroconf?

I ve recently checked out Apache Chainsaw as a viewer for my log4net logs. One feature that struck me as interesting is zeroconf: http://logging.apache.org/log4j/companions/zeroconf/apidocs/org/apache/...

Can Bonjour browse a service with a particular name?

Bonjour provides "DNSSD.browse(serviceType,callBackObject)" method which browses for services of a particular type. If a service of the given type is found, Bonjour calls "callBackObject.serviceFound"....

Can I use Bonjour from command line?

Is it possible to use Bonjour from command line? For example if I want to register a service I type something like that: bonjour -register service_name port. And then Bonjour allocate a free IP for my ...

How do I build a DNS Query record in Erlang?

I am building a native Bonjour / Zeroconf library and need to build DNS query records to broadcast off to the other machines. I have tried looking thru the Erlang source code but as I am relatively ...

热门标签