2013-05-22 22:38:26 +00:00
|
|
|
# vagrant-cachier
|
|
|
|
|
2015-05-08 22:50:53 +00:00
|
|
|
[![Gem Version](https://badge.fury.io/rb/vagrant-cachier.png)](http://badge.fury.io/rb/vagrant-cachier) [![Gitter chat](https://badges.gitter.im/fgrehm/vagrant-cachier.png)](https://gitter.im/fgrehm/vagrant-cachier)
|
2014-02-21 00:58:13 +00:00
|
|
|
|
2013-05-22 22:38:26 +00:00
|
|
|
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
|
2015-04-07 07:19:26 +00:00
|
|
|
package cache among similar 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 targeting
|
2013-05-22 22:38:26 +00:00
|
|
|
multiple package managers and Linux distros.
|
|
|
|
|
2015-05-08 22:50:53 +00:00
|
|
|
## Help Needed!
|
|
|
|
|
|
|
|
This project is looking for maintainers, please see [GH-143](https://github.com/fgrehm/vagrant-cachier/issues/143) for more.
|
2013-05-22 22:38:26 +00:00
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
2014-01-02 03:28:10 +00:00
|
|
|
Make sure you have Vagrant 1.4+ and run:
|
2013-05-22 22:38:26 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
vagrant plugin install vagrant-cachier
|
|
|
|
```
|
|
|
|
|
2013-12-07 14:36:38 +00:00
|
|
|
## Quick start
|
2013-05-22 22:38:26 +00:00
|
|
|
|
|
|
|
```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-05 22:48:28 +00:00
|
|
|
# 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
|
2014-02-01 01:02:11 +00:00
|
|
|
|
2014-06-23 21:01:00 +00:00
|
|
|
# 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
|
2014-02-01 01:02:11 +00:00
|
|
|
config.cache.synced_folder_opts = {
|
2014-02-01 06:36:00 +00:00
|
|
|
type: :nfs,
|
2014-02-01 01:02:11 +00:00
|
|
|
# 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.
|
2014-02-05 21:01:30 +00:00
|
|
|
mount_options: ['rw', 'vers=3', 'tcp', 'nolock']
|
2014-02-01 01:02:11 +00:00
|
|
|
}
|
|
|
|
# For more information please check http://docs.vagrantup.com/v2/synced-folders/basic_usage.html
|
2014-01-07 07:58:30 +00:00
|
|
|
end
|
2013-05-22 22:38:26 +00:00
|
|
|
end
|
|
|
|
```
|
|
|
|
|
2013-12-07 14:36:38 +00:00
|
|
|
For more information please read the documentation available at
|
|
|
|
http://fgrehm.viewdocs.io/vagrant-cachier.
|
2013-05-22 22:38:26 +00:00
|
|
|
|
|
|
|
|
2014-02-05 21:50:15 +00:00
|
|
|
## Providers that are known to work
|
2013-05-22 22:38:26 +00:00
|
|
|
|
2014-05-14 00:24:48 +00:00
|
|
|
* Vagrant's built in VirtualBox and Docker providers
|
2013-05-22 22:38:26 +00:00
|
|
|
* [vagrant-lxc](https://github.com/fgrehm/vagrant-lxc)
|
2013-08-05 16:14:44 +00:00
|
|
|
* [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-06-23 21:00:32 +00:00
|
|
|
* [vagrant-libvirt](https://github.com/pradels/vagrant-libvirt)
|
|
|
|
* [vagrant-kvm](https://github.com/adrahon/vagrant-kvm)
|
2014-05-14 00:24:48 +00:00
|
|
|
* _[Let us know if it is compatible with other providers!](https://github.com/fgrehm/vagrant-cachier/issues/new)_
|
2013-05-22 22:38:26 +00:00
|
|
|
|
2014-02-05 21:50:15 +00:00
|
|
|
_Please note that as of v0.6.0 the plugin will automatically disable any
|
|
|
|
previously defined configs for [cloud providers](lib/vagrant-cachier/plugin.rb#L19-22)_
|
|
|
|
|
2013-08-15 03:46:28 +00:00
|
|
|
|
2013-05-22 22:38:26 +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
|