From fdd6daa5fc4fac2a6b98e85e11ac970bd0c1675d Mon Sep 17 00:00:00 2001 From: Roman Heinrich Date: Wed, 17 Jul 2013 18:39:15 +0200 Subject: [PATCH] readme for apt-cacher --- README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/README.md b/README.md index e0f86e4..2697093 100644 --- a/README.md +++ b/README.md @@ -199,6 +199,37 @@ folder under the result of running `rvm info` as the default SSH user (usualy it is already installed before enabling the bucket, otherwise you won't benefit from this plugin. + +##### APT-CACHER + +```ruby +Vagrant.configure("2") do |config| + config.vm.box = 'some-debian-box' + config.cache.enable :apt_cacher +end +``` + +This is useful, if you are using containers inside your VMs, e.g VirtualBox -> LXC. This would allow you to reuse packages without sharing folder inside VirtualBox. Only works with NFS-shared folders (since `vboxsf` is enforcing `vagrant`-user and `apt-cacher` is running under `apt-cacher-ng` user) + + # install apt-cacher on (Host)-VM + $ sudo apt-get install apt-cacher-ng + + # get the IP for eth0 interface + $ ifconfig eth0 |grep "inet addr"|awk '{print $2}' |cut -c6-20 + + # configure mirror on for your docker/LXC instances: + $ echo 'Acquire::http { Proxy "http://X.X.X.X:3142"; };' > /etc/apt/apt.conf.d/10mirror + + # check, if working by tailing log on (Host)-VM, while installing packages on (Guest)-VMs + $ tail -f /var/log/apt-cacher-ng/apt-cacher.log + + +Used by Debian-like Linux distros, will get configured under guest's `/var/cache/apt-cacher-ng`. + +_Please note that to avoid re-downloading packages, you should avoid `apt-get clean` +as much as possible in order to make a better use of the cache, even if you are +packaging a box_ + ## Finding out disk space used by buckets _TODO_