{"id":13416229,"url":"https://github.com/silarsis/docker-proxy","last_synced_at":"2026-01-10T19:34:41.316Z","repository":{"id":15248043,"uuid":"17977022","full_name":"silarsis/docker-proxy","owner":"silarsis","description":"Transparent proxy for docker containers, run in a docker container","archived":false,"fork":false,"pushed_at":"2022-03-29T11:26:36.000Z","size":118,"stargazers_count":280,"open_issues_count":6,"forks_count":66,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-07-31T21:55:40.876Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/silarsis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-21T10:56:12.000Z","updated_at":"2024-07-23T23:30:51.000Z","dependencies_parsed_at":"2022-08-02T20:15:44.439Z","dependency_job_id":null,"html_url":"https://github.com/silarsis/docker-proxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silarsis%2Fdocker-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silarsis%2Fdocker-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silarsis%2Fdocker-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silarsis%2Fdocker-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/silarsis","download_url":"https://codeload.github.com/silarsis/docker-proxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243663498,"owners_count":20327299,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T21:00:55.748Z","updated_at":"2025-03-14T23:31:23.397Z","avatar_url":"https://github.com/silarsis.png","language":"Shell","readme":"# docker-proxy\n\nTransparent caching proxy server for Docker containers, run in a Docker\ncontainer. It can speed up the dependency-fetching part of your application\nbuild process.\n\n## Instructions for Use\n\nFirst check out the code. Then build with:\n\n```\nsudo docker build -t docker-proxy .\n```\n\nThen run with:\n\n```\n./run.sh\n```\n\nThe script will start the container and set up the appropriate\nrouting rules. Your other Docker containers will automatically use\nthe proxy, whether or not they were already running. When you are finished,\njust press \u003ckbd\u003eCtrl\u003c/kbd\u003e\u003ckbd\u003eC\u003c/kbd\u003e to stop the proxy.\n\nNOTE: This project is _not_ designed to be run with a simple `docker run` - it\nrequires `run.sh` to be run on the docker host, so it can adjust the\nrouting rules. You will need to check this code out\nand run `run.sh` on the host. For OS X, that's on your [boot2docker],\nDocker Machine or similar host). To start under [Docker Machine] on OS X:\n\n```\ndocker-machine scp run.sh default:/home/docker/run.sh\ndocker-machine ssh default\nsh ./run.sh\n```\n\n[boot2docker]: http://boot2docker.io/\n[Docker Machine]: https://docs.docker.com/machine/get-started/\n\n## Overview\n\n`run.sh` will fire up a Docker container running Squid, with\nappropriate firewall rules in place for transparent proxying. It will also\nconfigure port-based routing on the main host such that any traffic from a\nDocker container to port 80 routes via the transparent proxy container. It\nrequires `sudo` access to perform the firewall changes, and it will prompt you\nfor your password as appropriate.\n\n`run.sh` is designed to run in the foreground, because when the\ncontainer terminates it needs to remove the rules that were redirecting the\ntraffic.\n\nIf you want to see Squid in operation, you can (in another terminal) attach\nto the `docker-proxy` container - it is tailing the access log, so will show a\nrecord of requests made.\n\n## HTTPS Support\n\nThe proxy server supports HTTPS caching via Squid's [SSL Bump] feature. To\nenable it, start with:\n\n```\n./run.sh ssl\n```\n\nThe server will decrypt traffic from the server and encrypt it again using its\nown root certificate. HTTPS connections from your other Docker containers will\nfail until you install the root certificate. To install it:\n\n 1. Install the `ca-certificates` package (Debian/Ubuntu images)\n 2. Run [`detect-proxy.sh`]\n\nThose steps can be performed in a running container (for testing), or you can\nadd them to your `Dockerfile`. `detect-proxy.sh` can be run after you install\nyour OS packages with apt, because apt shouldn't need HTTPS. However, adding\nPPAs with `add-apt-repository` will fail until the certificate is installed. See\n[`test/Dockerfile`] for an example.\n\nSome programs don't use the OS's primary key store, such as `npm` and `pip`.\nYou may need to take extra steps for those programs.\n\nTo test HTTPS support, do this in another console after starting the proxy:\n\n```\ncd test\nsudo docker build -t test-proxy .\nsudo docker run --rm test-proxy\n# Should print \"All tests passed\"\n```\n\n[SSL Bump]: http://wiki.squid-cache.org/Features/SslBump\n[`detect-proxy.sh`]: test/detect-proxy.sh\n[`test/Dockerfile`]: test/Dockerfile\n\n## Notes\n\nThis proxy configuration is intended to be used solely to speed\nup development of Docker applications. **Do not** attempt to use this to\neavesdrop on other people's connections.\n\nThere exists a real possibility this script will break your `iptables` or `ip`\nrules in some unexpected way. Be aware that if things go wrong, the potential\nexists for all containers to lose the ability to download anything.\n","funding_links":[],"categories":["Container Operations","Shell","Reverse Proxy"],"sub_categories":["Reverse Proxy"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilarsis%2Fdocker-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsilarsis%2Fdocker-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilarsis%2Fdocker-proxy/lists"}