I
I
Ivan2018-02-27 21:15:15
Docker
Ivan, 2018-02-27 21:15:15

How to cut off the Internet to the container?

Something I just can’t figure out how to cut off the Internet for ONE of the containers (Linux). That is, so that the application in the container cannot download anything from the Internet or send any data. At the same time, the ability to communicate with the host and other containers must be preserved.
In Google, I found only advice to cut off ip forwarding (echo 0 > /proc/sys/net/ipv4/ip_forward), but it does not work, because it cuts off ALL containers from the Internet.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
chupasaurus, 2018-02-27
@chupasaurus

docker create network --internal no-internets, make it the only network for the isolated container, add this network along with the one already used for the others.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question