是否可以在外部互联网上将用户定义的覆盖网络中的docker容器隔离开来? [英] Is it possible to isolate docker container in user-defined overlay network from outside internet?
问题描述
如果添加<$ c $在使用 docker network create
命令创建网络时,c> - 内部标志,则该网络将不具有出站网络访问权限:
docker network create --internal --subnet 10.1.1.0/24 mynetwork
我假设 - 但没有测试 - 这适用于覆盖网络以及主机 - 本地网络。
With new network feature in docker 1.10 it is possible to create isolated overlay networks - which works very well. Containers in 2 separate networks can not talk to each other. Is it possible, however, to deny container in overlay network to reach public internet? Eg to make ping 8.8.8.8 fail, while having docker host connected to internet.
If you add the --internal
flag when creating a network with the docker network create
command, then that network will not have outbound network access:
docker network create --internal --subnet 10.1.1.0/24 mynetwork
I assume -- but have not tested -- that this works for overlay networks as well as for host-local networks.
这篇关于是否可以在外部互联网上将用户定义的覆盖网络中的docker容器隔离开来?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!