docker在docker-compose.yml中设置iptables选项

时间:2015-06-15 13:56:09

标签: docker

我使用docker-compose来管理容器。

如何在通过docker-compose启动时关闭iptables(为docker设置--iptables = false)?

2 个答案:

答案 0 :(得分:11)

The --iptables option only applies to the Docker daemon; it's not a per-container option. The corollary is that this isn't something you could ever set from your docker-compose.yaml file.

You would need to modify the options passed to the Docker daemon; on Red Hat systems and derivatives this means you would modify /etc/sysconfig/docker and updte the OPTIONS= line (and restart Docker). There will be a similar process for other distributions.

答案 1 :(得分:0)

如果您正在寻找这种自动化水平,可以查看saltstack。它们具有dockerng状态,允许您指定选项。

https://docs.saltstack.com/en/latest/ref/states/all/salt.states.dockerng.html

相关问题