2013-12-07 04:10:11 +00:00
|
|
|
# vagrant-cachier
|
|
|
|
|
|
|
|
A [Vagrant](http://www.vagrantup.com/) plugin that helps you reduce the amount of
|
|
|
|
coffee you drink while waiting for boxes to be provisioned by sharing a common
|
|
|
|
package cache among similiar VM instances. Kinda like [vagrant-apt_cache](https://github.com/avit/vagrant-apt_cache)
|
|
|
|
or [this magical snippet](http://gist.github.com/juanje/3797297) but targetting
|
|
|
|
multiple package managers and Linux distros.
|
|
|
|
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
2014-01-02 03:28:10 +00:00
|
|
|
Make sure you have Vagrant 1.4+ and run:
|
2013-12-07 04:10:11 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
vagrant plugin install vagrant-cachier
|
|
|
|
```
|
|
|
|
|
|
|
|
## Quick start
|
|
|
|
|
2013-12-07 14:36:03 +00:00
|
|
|
The easiest way to set things up is just to enable [cache buckets auto detection](usage)
|
2013-12-07 04:10:11 +00:00
|
|
|
from within your `Vagrantfile`:
|
|
|
|
|
|
|
|
```ruby
|
|
|
|
Vagrant.configure("2") do |config|
|
|
|
|
config.vm.box = 'your-box'
|
2014-01-07 07:58:30 +00:00
|
|
|
if Vagrant.has_plugin?("vagrant-cachier")
|
2014-02-01 01:02:11 +00:00
|
|
|
# Enable cache buckets auto detection
|
2014-01-07 07:58:30 +00:00
|
|
|
config.cache.auto_detect = true
|
2014-02-01 01:02:11 +00:00
|
|
|
|
|
|
|
# You can pass in extra mount options for your cache buckets
|
|
|
|
# from http://docs.vagrantup.com/v2/synced-folders/basic_usage.html
|
|
|
|
config.cache.synced_folder_opts = { create: true }
|
|
|
|
|
|
|
|
# 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']
|
|
|
|
}
|
2014-01-07 07:58:30 +00:00
|
|
|
end
|
2013-12-07 04:10:11 +00:00
|
|
|
end
|
|
|
|
```
|
|
|
|
|
|
|
|
For more information please check out the links on the menu above.
|
|
|
|
|
|
|
|
|
|
|
|
## Compatible providers
|
|
|
|
|
|
|
|
* Vagrant's built in VirtualBox provider
|
|
|
|
* [vagrant-lxc](https://github.com/fgrehm/vagrant-lxc)
|
|
|
|
* [VMware providers](http://www.vagrantup.com/vmware) with NFS enabled (See
|
|
|
|
[GH-24](https://github.com/fgrehm/vagrant-cachier/issues/24) for more info)
|
2014-02-01 01:02:11 +00:00
|
|
|
* [vagrant-libvirt](https://github.com/pradels/vagrant-libvirt)
|
2013-12-07 04:10:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
## Contributing
|
|
|
|
|
|
|
|
1. Fork it
|
|
|
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
|
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
|
|
4. Push to the branch (`git push origin my-new-feature`)
|
|
|
|
5. Create new Pull Request
|