A caching package proxy for Pacman (Arch Linux) (although it probably can be adjusted for any package manager).
If you have multiple Arch Linux machines on your network; using this image can help speed up downloads and reduce network consumption.
It's really just a fancy NGINX Config adapted from this.
Once properly setup, when the Container recieves a request for a package that isn't present locally, it downloads it from the primary mirror and saves the .pkg.tar.xz file to disk.
Any requests for .db or .sig files are always sent upstream to the mirror.
docker run -d --name --paccache -p 8080:8080 -v /path/to/data/dir:/cache:rw -e okamidash/paccache
-
DNS_SERVER
DNS Server to use for NGINX. You can change this to any DNS you want.default:
1.1.1.1
-
SERVER_NAME
Domain Name/IP of Container. The default will respond to all requests.default:
_
-
PRIMARY_MIRROR
Primary mirror to use for proxying requests. It is recommended to change this.default:
https://mirrors.ukfast.co.uk/sites/archlinux.org
-
BACKUP_MIRROR
Backup mirror incase the primary mirror is down.default:
https://archlinux.uk.mirror.allworldit.com/archlinux
It is recommended that you change the default mirrors to ones that are closer to you.
Currently the Docker Container only supports ipv4 http and https, no Rsync or ftp yet.
To change them, I would suggest using Reflector.
Something like reflector -p http -p https -l 50 --ipv4 -f 10 --sort rate
will return the 10 fastest mirrors.
You will get a result like this.
Server = https://archlinux.uk.mirror.allworldit.com/archlinux/$repo/os/$arch
Server = https://archlinux.mailtunnel.eu/$repo/os/$arch
Server = https://mirror.orbit-os.com/archlinux/$repo/os/$arch
Server = https://pkg.adfinis-sygroup.ch/archlinux/$repo/os/$arch
Server = http://mirror.cyberbits.eu/archlinux/$repo/os/$arch
You only need to trim everything from $repo onwards; so https://archlinux.mailtunnel.eu/$repo/os/$arch
will be https://archlinux.mailtunnel.eu/
and https://archlinux.uk.mirror.allworldit.com/archlinux/$repo/os/$arch
becomes https://archlinux.uk.mirror.allworldit.com/archlinux/
Server = http://container_ip:container_port/$repo/os/$arch
Example using a container IP of 10.0.20.1, and -p 8080:8080
Server = http://10.0.20.1:8080/$repo/os/$arch
If you need any help, feel free to email me
okami @ doubledash.org
This is my first Docker Image, and I had help from friends building it; so I can't promise i'll be helpful.