Public Repository

Last pushed: 3 years ago
Short Description
apt-cacher-ng running on Debian
Full Description

Supported Tags

What is apt-cacher-ng?


A typical command line to launch would be something like:
docker run -d -p 3142:3142 -v /my-cache-dir:/CacheDir -v /my-log-dir:/LogDir chinnodog/apt-cacher-ng


  • 3142 is the default port. Unless you have a reason to change it I recommend you keep it.
  • /CacheDir is going to have a lot of .deb files in it. Put it somewhere with adequate storage. HDD is probably faster than SSD since the files are read sequentially.
  • /LogDir Put it somewhere nice or leave it in Docker. Supplied for convenience.

Client Configuration

Hint: To calculate the correct IP for the configurations below within a docker container you can use the following in bash:

     $(ip route ls | grep ^default | cut -f 3 -d ' ')

Ubuntu / Debian

Create file /etc/apt/apt.conf.d/02proxy with the following contents

Acquire::http { Proxy ""; };
Acquire::http { Pipeline-Depth "4"; } 

Use the correct IP and port, of course. The second line is optional but improves performance. You can potentially use a number much higher than 4 but you could overload the repository servers you are proxying. The default depth is 0.

CentOS 7 (and probably RedHat)

Add the following to /etc/yum.conf


Update the repos to use http instead of https

sed -ir 's/https:\/\//http:\/\//' /etc/yum.repos.d/*


  • Export apt-cacher-ng file system for use on systems with low disk space
Docker Pull Command