Skip to content

Instantly share code, notes, and snippets.

@mashimom
Created June 20, 2015 19:13
Show Gist options
  • Save mashimom/258639c291669e120b1d to your computer and use it in GitHub Desktop.
Save mashimom/258639c291669e120b1d to your computer and use it in GitHub Desktop.
Add a local cache to all apt, yum and npm operations (~/.vagrant.d/Vagrantfile)
Vagrant.configure("2") do |config|
config.vm.box = 'your-box'
if Vagrant.has_plugin?("vagrant-cachier")
# Configure cached packages to be shared between instances of the same base box.
# More info on http://fgrehm.viewdocs.io/vagrant-cachier/usage
config.cache.scope = :box
# OPTIONAL: If you are using VirtualBox, you might want to use that to enable
# NFS for shared folders. This is also very useful for vagrant-libvirt if you
# want bi-directional sync
# config.cache.synced_folder_opts = {
# type: :nfs,
## The nolock option can be useful for an NFSv3 client that wants to avoid the
## NLM sideband protocol. Without this option, apt-get might hang if it tries
## to lock files needed for /var/cache/* operations. All of this can be avoided
## by using NFSv4 everywhere. Please note that the tcp option is not the default.
# mount_options: ['rw', 'vers=3', 'tcp', 'nolock']
# }
# For more information please check http://docs.vagrantup.com/v2/synced-folders/basic_usage.html
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment