我正在尝试在容器中设置网络(使用Docker的libnetworklibcontainer),但是我一直遇到这个问题。据我所知,它正在研究some_app以获取一些沙箱信息?

INFO[3808] No non-localhost DNS nameservers are left in resolv.conf. Using default external servers : [nameserver 8.8.8.8 nameserver 8.8.4.4]
INFO[3808] IPv6 enabled; Adding default IPv6 external servers : [nameserver 2001:4860:4860::8888 nameserver 2001:4860:4860::8844]
Error: unknown command "/var/run/docker/netns/582bd184e561" for "some_app"
Run 'some_app --help' for usage.
ERRO[3808] Resolver Setup/Start failed for container 6b81802576bd4f16aa117061f81b5c3e, "setup not done yet"
ERRO[3808] failed to add interface vethef0a693 to sandbox: failed in prefunc: failed to set namespace on link "vethef0a693": invalid argument
ERRO[3808] failed to add interface vethef0a693 to sandbox: failed in prefunc: failed to set namespace on link "vethef0a693": invalid argument

我想知道是否有人可以帮助我理解这一点,也许可以阻止它。这是两个单独的错误吗?

谢谢

Here is the library I am trying to use

最佳答案

我花了一些时间才弄清楚这一点,但这里有:

就像在Docker中一样,libnetwork创建了一个veth接口对。然后,将第七对的一端移到容器名称空间中。在此过程中,libnetwork尝试在运行时在二进制的当前实例上执行注册的命令(在这种情况下为some_app)。

但是,这些命令在some_app的外部接口上不存在。稍后使用称为 reexec 的库将它们注入。为此,reexec需要像这样初始化:

if reexec.Init() {
    return
}

还要注意,根据this thread,Docker之外的应用程序当前不支持libnetwork

注意:我通过阅读源代码发现了这一点,所以我可能是错的,但是在此之后我的问题就消失了。

关于go - libnetwork:错误:“some_app”的未知命令“/var/run/docker/netns/582bd184e561”,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/35633666/

10-10 18:08