I'm using apt-cache-ng which acts as a proxy between my docker build and apt packages server, so all my downloads through apt-get
are cached.
I'd like to do something similar for files that I wget
. For example, to install latest version of scala, I can't get it from apt and need to install it from a .deb
file downloaded from their website.
Is there an easy way to cache wget calls made (maybe all HTTP(S) calls made for file downloads) when I'm building with docker?
wget supports the variables HTTP_PROXY and HTTPS_PROXY (https://stackoverflow.com/a/18722273/4124767). docker build does support setting this variables by
docker build --build-arg HTTP_PROXY=http://my.proxy:8080
: https://docs.docker.com/engine/reference/builder/#predefined-argsNot sure what proxy to use. Squid? ...
maybe squid combined with apt-cacher is interesting: https://www.porcheron.info/bandwith-optimization-squid-apt-cacher-and-jesred/