Running docker container via mitmproxy

I am trying to route all the docker container traffic through mitmproxy running in another docker container. In order for mitmproxy to work, I need to change the gateway IP address of the original docker container. Here is an example of what I want to do, but I want to limit it completely inside docker containers: http://blog.philippheckel.com/2013/07/01/how-to-use-mitmproxy-to-read-and-modify -https-traffic-of-your-phone / .

Any thoughts on how I can do this? In addition, I want to avoid using either of the two docker containers in privileged mode.

+4
source share
1 answer

, , . , . , , CAP_NET_ADMIN ( : http://man7.org/linux/man-pages/man7/capabilities.7.html), --cap-add NET_ADMIN .

, .

"" NAT iptables mitmproxy, mitmproxy ( -T, ). script - , Docker .

"" ip route, IP- - . , , script , . : - . script IP- - .

, mitmproxy ( - HTTP), . .

, !

+2

All Articles