Skip to content

Instantly share code, notes, and snippets.

@ananelson
Created June 28, 2014 19:13
Show Gist options
  • Save ananelson/7a360060a0a7b85d67f0 to your computer and use it in GitHub Desktop.
Save ananelson/7a360060a0a7b85d67f0 to your computer and use it in GitHub Desktop.
Squid for Docker, if it's on host OS
ENV HOST_IP_FILE /tmp/host-ip.txt
RUN /sbin/ip route | awk '/default/ { print "http://"$3":8000" }' > $HOST_IP_FILE
RUN HOST_IP=`cat $HOST_IP_FILE` && curl -s $HOST_IP | grep squid && echo "Found active squid!" && echo "Acquire::http::Proxy \"$HOST_IP\";" > /etc/apt/apt.conf.d/30proxy || echo "no squid"
@ananelson
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment