Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker set iptables options in docker-compose.yml

Tags:

docker

I'm using docker-compose for managing containers.

How to I turn off iptables (set --iptables=false for docker) when starting via docker-compose up?

like image 995
Zhani Baramidze Avatar asked Jun 15 '15 13:06

Zhani Baramidze


People also ask

Can I run iptables in Docker container?

Docker installs two custom iptables chains named DOCKER-USER and DOCKER , and it ensures that incoming packets are always checked by these two chains first. All of Docker's iptables rules are added to the DOCKER chain. Do not manipulate this chain manually.

How do I specify proxy in Dockerfile?

We simply need to set the http_proxy and https_proxy environmental variables during build time. We can do this with the docker build command itself. $ sudo docker build -t curl --build-arg http_proxy=http://192.168.33.10:3128 . Or we can specify the http_proxy value using the ENV instruction within the Dockerfile .


1 Answers

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.

like image 82
larsks Avatar answered Sep 28 '22 11:09

larsks