Skip to content

Instantly share code, notes, and snippets.

@matiskay
Forked from fnichol/README.md
Created February 12, 2013 19:37
Show Gist options
  • Save matiskay/4772703 to your computer and use it in GitHub Desktop.
Save matiskay/4772703 to your computer and use it in GitHub Desktop.

Vagrant apt-cacher-ng Box

Simple and easy, just:

mkdir apt-cacher-ng && cd apt-cacher-ng
curl -LO https://raw.github.com/gist/1747868/Vagrantfile
vagrant up

Tail the logs perhaps?

vagrant ssh
sudo tail -f /var/log/apt-cacher-ng/apt-cacher.*

To use the caching box, determine your workstation's IP address and run the following on your Ubuntu/Debian node:

workstation_ip="xxx.xxx.xxx.xxx"
cat <<PROXY > /etc/apt/apt.conf.d/01proxy
Acquire::http::Proxy "http://${workstation_ip}:3142";
PROXY
#!/usr/bin/env ruby
# coding: utf-8
Vagrant::Config.run do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.customize ["modifyvm", :id, "--memory", "128"]
config.vm.forward_port 3142, 3142
config.vm.provision :shell do |shell|
shell.inline = "apt-get update && apt-get install -y apt-cacher-ng"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment