打开泊坞窗守护容器外

问题描述:

泊坞窗守护容器从当我们运行它低于外界隔离,打开泊坞窗守护容器外

$ docker run -d --name test_container ubuntu/ping \ 
/bin/sh -c "while true do echo hello world; sleep 1; done" 

$ docker inspect test_container | grep IPAddress 
[ip of test_container] 

$ ping [ip of test_container] 
[timeout] 

$ ifconfig docker0 | grep "inet addr" 
[ip of docker bridge] 

$ ping [ip of docker bridge] 
[ok] 

$ docker exec -it test_container /bin/bash 

# ping [ip of test_container] 
[ok] 

# ping [ip of docker bridge] 
[timeout] 

如何打开内而外的泊坞窗守护容器的IP地址?

默认情况下,搬运工人守护进程在Unix套接字运行

您可以启用做对TCP套接字听:

码头工人守护-H TCP:// validIpOnYourHost:端口

默认情况下,如果您不提供某些端口,则端口为2375。

比照此页面了解更多的解释:https://docs.docker.com/v1.11/engine/reference/commandline/daemon/

要小心,如果你暴露泊坞窗throught TCP,这是没有启用安全。

也许我说别的东西,读你的问题后:

,你可以做:

泊坞窗网检查桥

并粘贴JSON输出。 我有类似的问题时,该属性:

“com.docker.network.bridge.enable_ip_masquerade”

设置为false

+0

'enable_ip_masquerade'设置为TRUE;,但'host_binding_ipv4'设置为'0.0.0.0'。 – sof

+0

由于某些原因,您提供的commnd行在shell中生成了一个错误:您可能会重试** docker run --name test_container ubuntu/ping/bin/sh -c“while true; echo hello world; sleep 10;完成; ** –

+0

我有相同的输出:''选项“:{ ”com.docker.network.bridge.default_bridge“:”true“, ”com.docker.network.bridge.enable_icc“:”true“ , “com.docker.network.bridge.enable_ip_masquerade”:“true”, “com.docker.network.bridge.host_binding_ipv4”:“0.0.0.0”, “com.docker.network.bridge.name”: “docker0”, “com.docker.network.driver.mtu”:“1500” }' –