commit d48e0bcffb02f5699ba862a933945ef26506014b Author: Panagiotis Moustafellos Date: Mon Aug 18 19:22:46 2014 +0300 first commit diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ac9c6b7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +FROM ubuntu:trusty +MAINTAINER Panagiotis Moustafellos + +# update and install squid-deb-proxy +RUN apt-get update && \ + apt-get -y upgrade && \ + apt-get install -y squid-deb-proxy squid-deb-proxy-client + +# Extra locations to cache from +ADD extra-sources.acl /etc/squid-deb-proxy/mirror-dstdomain.acl.d/20-extra-sources.acl + +# Point cache directory to /cachedir (80GB volume) and remove logging +RUN sed -ri 's/cache_dir aufs \/var\/cache\/squid-deb-proxy 40000 16 256/cache_dir aufs \/cachedir 8000 16 256/' /etc/squid-deb-proxy/squid-deb-proxy.conf && \ + sed -i '/^cache_access_log/d' /etc/squid-deb-proxy/squid-deb-proxy.conf && \ + sed -i '/^cache_log/d' /etc/squid-deb-proxy/squid-deb-proxy.conf && \ + sed -i '/^cache_store_log/d' /etc/squid-deb-proxy/squid-deb-proxy.conf; + + +ADD start.sh /start.sh +RUN chmod +x /start.sh + +VOLUME ["/cachedir"] + +EXPOSE 8000 + +ENTRYPOINT ["/start.sh"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..1010d4f --- /dev/null +++ b/README.md @@ -0,0 +1,19 @@ +squid-deb-proxy Docker container +================================ + +squid-deb-proxy provides an easy wrapper over squid3 to enable package proxy caching for your organisation/LAN. + +This Docker container image allows most (if not all) non-routeable LAN subnets and caches from sources found under `extra-sources.acl` + +Usage: + +* On Server / Host: + +`docker run --name proxy --rm -v /path/to/cachedir:/cachedir -p PORT:8000 pmoust/squid-deb-proxy &` + +* On a node + +``` +apt-get install squid-deb-proxy-client +echo 'Acquire::http::Proxy "http://HOST_IP:PORT";' > /etc/apt/apt.conf.d/30autoproxy +``` diff --git a/extra-sources.acl b/extra-sources.acl new file mode 100644 index 0000000..4a44ca4 --- /dev/null +++ b/extra-sources.acl @@ -0,0 +1,21 @@ +ppa.launchpad.net # Foreign PPA +private-ppa.launchpad.net +download.virtualbox.org # Oracle VM +dl.bintray.com # Vagrant et al +releases.ansible.com # Ansible +dl.google.com # Google repositories +raw.githubusercontent.com # Static files from github +github.com # Github http checkout +get.docker.io # Docker +dl.dropboxusercontent.com # Dropbox URI +cloud-images.ubuntu.com # Base vboxes +puppet-vagrant-boxes.puppetlabs.com # Beaker/Puppet vboxes +gr.archive.ubuntu.com # Greek mirror +us.archive.ubuntu.com # USA mirror +uk.archive.ubuntu.com # UK mirror +www.openprinting.org # Printer drivers (ubuntu extras) +linux.dropbox.com # Dropbox +deb.opera.com # Opera +downloads-distro.mongodb.org # MongoHQ +repository.spotify.com # Spotify +repo.steampowered.com # Steam diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..2493185 --- /dev/null +++ b/start.sh @@ -0,0 +1,5 @@ +#!/bin/sh +chown -R proxy.proxy /cachedir +. /usr/share/squid-deb-proxy/init-common.sh +pre_start +/usr/sbin/squid3 -N -f /etc/squid-deb-proxy/squid-deb-proxy.conf