dtxb75622 2016-02-25 17:01
浏览 149
已采纳

libnetwork:错误:“ some_app”的未知命令“ / var / run / docker / netns / 582bd184e561”

I am trying to setup a network in the container (using Docker's libnetwork and libcontainer), but I keep running into this issue. As far as I can tell it's looking into some_app to get some sandbox information?

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 

I was wondering if anyone could help me make sense of this and perhaps prevent it. Are these two separate errors?

Thank you

Here is the library I am trying to use

  • 写回答

1条回答 默认 最新

  • douju5062 2016-03-14 12:56
    关注

    It took me a while to figure this out, but here goes:

    Just like in Docker, libnetwork creates a veth interface pair. It then moves one end of the veth pair into the container namespace. During this process libnetwork tries to execute commands registered at runtime on the current instance of the binary (some_app in this case).

    These commands do not exist on the external interface of some_app however. They are injected later using a library called reexec. For this to work, reexec needs to be initialized like this:

    if reexec.Init() {
        return
    }
    

    Also note that according to this thread libnetwork is currently not supported for applications outside of Docker.

    NB: I discovered this by reading the source code, so I might be wrong but my issue went away after this.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?