Giter Site home page Giter Site logo

docker-proxy's Introduction

docker-proxy

Transparent proxy for docker containers, run in a docker container

Instructions for Use

The "run.sh" script will run the container and setup the appropriate iptables and ip routing rules.

Overview

The run.sh script will fire up a docker container running squid, with appropriate iptables rules in place for transparent proxying. It will also configure port-based routing on the main host such that any traffic from a docker container to port 80 routes via the transparent proxy container.

The run.sh script is designed to run in the foreground, because when the container terminates it needs to remove the rules that were redirecting the traffic.

If you want to see squid in operation, you can (in another terminal) attach to the squid container - it is tailing the access log, so will show a record of requests made.

Notes

  • This script assumes you have "sudo" access to perform the iptables changes

  • the format of the run.sh script is a bit strange - that's because it's also used as part of a larger framework on my own machine.

  • There exists a real possibility this script will break your iptables or ip rules in some unexpected way. I've tried to be reasonably tidy and careful, but be aware that if things go wrong, the potential exists for all containers to lose the ability to download anything.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.