A caching proxy. Specialized for package files from Linux distributors, primarily for Debian (and Debian based) distributions but not limited to those. See documentation of Apt-Cacher to learn what it's good for.
https://www.unix-ag.uni-kl.de/~bloch/acng/
docker run -d --name apt-cacher-ng -e "AUTH_USERNAME=username" -e "AUTH_PASSWORD=password" -p sark/apt-cacher-ng
This image includes EXPOSE 3142
(the apt-cacher-ng port), so standard container linking will make it automatically available to the linked containers.
docker run -d --name apt-cacher-ng -e "AUTH_USERNAME=username" -e "AUTH_PASSWORD=password" -p 3142:3142 sark/apt-cacher-ng
These are three methods of using apt-get with a http-proxy.
echo 'Acquire::http { Proxy "http://dockerhost:3142"; };' >> /etc/apt/apt.conf.d/01proxy
export http_proxy=http://dockerhost:3142
docker run --rm -i -t -e "http_proxy=http://dockerhost:3142" debian:wheezy /bin/bash
Edit the /etc/apt/sources.list file and edit the source lines therein, replacing the mirror hostname with the hostname of this server machine and the port with 3142 (adding a port if none specified). For example:
# Before
deb http://ftp.debian.org/debian stable main contrib non-free
deb-src http://ftp.debian.org/debian stable main contrib non-free
# After
deb http://dockerhost:3142/ftp.debian.org/debian stable main contrib non-free
deb-src http://dockerhost:3142/ftp.debian.org/debian stable main contrib non-free