Skip to content

Instantly share code, notes, and snippets.

@ptisserand
Created March 26, 2020 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptisserand/d2ceaea6f4ce4f9c86663bb823249164 to your computer and use it in GitHub Desktop.
Save ptisserand/d2ceaea6f4ce4f9c86663bb823249164 to your computer and use it in GitHub Desktop.
Start a proxy to speed up docker build
#!/bin/bash
CACHE_DIR=/srv/squid/cache
echo "Starting squid container"
docker run --rm --net host -v ${CACHE_DIR}:/var/cache/squid3 -d jpetazzo/squid-in-a-can
echo "Setup iptables"
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to 3129 -w
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment