Improve buckets docs
This commit is contained in:
parent
3c4a20f44d
commit
16b68e72f1
13 changed files with 83 additions and 50 deletions
|
@ -3,8 +3,8 @@
|
|||
During the early days of this plugin, [@fgrehm](https://github.com/fgrehm) wrote
|
||||
a [blog post](http://fabiorehm.com/blog/2013/05/24/stop-wasting-bandwidth-with-vagrant-cachier#show_me_the_numbers)
|
||||
with some benchmarks on the time that was cut down by using the plugin. If you
|
||||
are interested on the numbers only, the projects tested were one of vagrant-lxc's
|
||||
Ubuntu [dev box](https://github.com/fgrehm/vagrant-lxc/wiki/Development#using-virtualbox-for-development),
|
||||
are interested on the numbers only, the VMs tested were one of vagrant-lxc's
|
||||
Ubuntu [dev boxes](https://github.com/fgrehm/vagrant-lxc/wiki/Development#using-virtualbox-for-development),
|
||||
[rails-dev-box](https://github.com/rails/rails-dev-box), his own [rails-base-box](https://github.com/fgrehm/rails-base-box)
|
||||
and Discourse's [dev box](https://github.com/discourse/discourse/blob/master/Vagrantfile)
|
||||
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
# APT-CACHER
|
||||
|
||||
Used by Debian-like Linux distros, will get configured under guest's `/var/cache/apt-cacher-ng`
|
||||
and only works with NFS-shared folders since `vboxsf` is enforcing `vagrant`-user and `apt-cacher`
|
||||
is running under `apt-cacher-ng` user.
|
||||
|
||||
To manually enable it:
|
||||
|
||||
```ruby
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = 'some-debian-box'
|
||||
|
@ -7,10 +13,9 @@ Vagrant.configure("2") do |config|
|
|||
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)
|
||||
One use case for this bucket is if you are using containers inside your VMs, e.g
|
||||
VirtualBox -> LXC. This would allow you to reuse packages without sharing folder
|
||||
inside VirtualBox:
|
||||
|
||||
# install apt-cacher on (Host)-VM
|
||||
$ sudo apt-get install apt-cacher-ng
|
||||
|
@ -23,7 +28,3 @@ is running under `apt-cacher-ng` user)
|
|||
|
||||
# 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`.
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
# APT
|
||||
|
||||
Used by Debian-like Linux distros, will get configured under guest's `/var/cache/apt/archives`.
|
||||
|
||||
To manually enable it:
|
||||
|
||||
```ruby
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = 'some-debian-box'
|
||||
|
@ -7,8 +11,7 @@ Vagrant.configure("2") do |config|
|
|||
end
|
||||
```
|
||||
|
||||
Used by Debian-like Linux distros, will get configured under guest's `/var/cache/apt/archives`.
|
||||
|
||||
_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_
|
||||
packaging a box since the downloaded packages are actually stored on the host
|
||||
machine._
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
# Chef
|
||||
|
||||
When a Chef provisioner is detected, this bucket caches the default
|
||||
`file_cache_path` directory, `/var/chef/cache`. Requires Vagrant 1.2.4+.
|
||||
|
||||
To manually enable it:
|
||||
|
||||
```ruby
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = 'some-box-using-chef-provisioner'
|
||||
config.cache.enable :chef
|
||||
end
|
||||
```
|
||||
|
||||
When a Chef provisioner is detected, this bucket caches the default
|
||||
`file_cache_path` directory, `/var/chef/cache`. Requires Vagrant 1.2.4+.
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
# [Composer](http://getcomposer.org/)
|
||||
|
||||
Compatible with probably any type of linux guest distro, will cache guests'
|
||||
`$HOME/.composer` if PHP is detected.
|
||||
|
||||
To manually enable it:
|
||||
|
||||
```ruby
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = 'some-box-with-php-installed'
|
||||
config.cache.enable :composer
|
||||
end
|
||||
```
|
||||
|
||||
Compatible with probably any type of linux guest distro, will cache guests'
|
||||
`$HOME/.composer` if PHP is detected.
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
# [npm](https://npmjs.org/)
|
||||
|
||||
Compatible with probably any type of linux guest distro, will hook into npm's
|
||||
cache directory under the result of running `npm config get cache` as
|
||||
the default SSH user (usually `vagrant`) on your guest.
|
||||
|
||||
To manually enable it:
|
||||
|
||||
```ruby
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = 'some-box-with-nodejs-installed'
|
||||
|
@ -7,10 +13,6 @@ Vagrant.configure("2") do |config|
|
|||
end
|
||||
```
|
||||
|
||||
Compatible with probably any type of linux guest distro, will hook into npm's
|
||||
cache directory under the result of running `npm config get cache` as
|
||||
the default SSH user (usually `vagrant`) on your guest.
|
||||
|
||||
If you use [nvm](https://github.com/creationix/nvm) / [n](https://github.com/visionmedia/n)
|
||||
on the guest machine, make sure it is already installed before enabling
|
||||
the bucket, otherwise you won't benefit from this plugin.
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
# Pacman
|
||||
|
||||
Used by Arch Linux, will get configured under guest's `/var/cache/pacman/pkg`.
|
||||
|
||||
To manually enable it:
|
||||
|
||||
```ruby
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = 'some-arch-linux-box'
|
||||
config.cache.enable :pacman
|
||||
end
|
||||
```
|
||||
|
||||
Used by Arch Linux, will get configured under guest's `/var/cache/pacman/pkg`.
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
# RubyGems
|
||||
|
||||
Compatible with probably with any type of guest distro, will hook into the `cache`
|
||||
folder under the result of running `gem env gemdir` as the default SSH user (usualy
|
||||
`vagrant`) on your guest. If you use rbenv / rvm on the guest machine, make sure
|
||||
it is already installed before enabling the bucket, otherwise you won't benefit
|
||||
from this plugin.
|
||||
|
||||
To manually enable it:
|
||||
|
||||
```ruby
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = 'some-box-with-ruby-installed'
|
||||
config.cache.enable :gem
|
||||
end
|
||||
```
|
||||
|
||||
Compatible with probably with any type of guest distro, will hook into the `cache`
|
||||
folder under the result of running `gem env gemdir` as the default SSH user (usualy
|
||||
`vagrant`) on your guest. If you use rbenv / rvm on the guest machine, make sure
|
||||
it is already installed before enabling the bucket, otherwise you won't benefit
|
||||
from this plugin.
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
# [rvm](https://rvm.io/)
|
||||
|
||||
Compatible with probably with any type of linux guest distro, will hook into the
|
||||
`cache` folder under the result of running rvm info as the default SSH user (usualy
|
||||
`vagrant`) on your guest. If you use rvm on the guest machine, make sure it is
|
||||
already installed before enabling the bucket, otherwise you won't benefit from
|
||||
this plugin.
|
||||
|
||||
To manually enable it:
|
||||
|
||||
```ruby
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = 'some-box-with-rvm-installed'
|
||||
config.cache.enable :gem
|
||||
end
|
||||
```
|
||||
|
||||
Compatible with probably with any type of linux guest distro, will hook into the
|
||||
`cache` folder under the result of running rvm info as the default SSH user (usualy
|
||||
`vagrant`) on your guest. If you use rvm on the guest machine, make sure it is
|
||||
already installed before enabling the bucket, otherwise you won't benefit from
|
||||
this plugin.
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
# Yum
|
||||
|
||||
Used by CentOS guests, will get configured under guest's `/var/cache/yum`. It will
|
||||
also [make sure](lib/vagrant-cachier/bucket/yum.rb#L20) that `keepcache` is set to
|
||||
`1` on guest's `/etc/yum.conf`.
|
||||
|
||||
To manually enable it:
|
||||
|
||||
```ruby
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = 'some-centos-box'
|
||||
config.cache.enable :yum
|
||||
end
|
||||
```
|
||||
|
||||
Used by CentOS guests, will get configured under guest's `/var/cache/yum`. It will
|
||||
also [make sure](lib/vagrant-cachier/bucket/yum.rb#L20) that `keepcache` is set to
|
||||
`1` on guest's `/etc/yum.conf`.
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
# Zypper
|
||||
|
||||
Used by SuSE guests, will get configured under guest's `/var/cache/zypp/packages`. It will
|
||||
also [make sure](lib/vagrant-cachier/bucket/zypper.rb#L20) that `keep-packages` is enabled
|
||||
for all repositories.
|
||||
|
||||
To manually enable it:
|
||||
|
||||
```ruby
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = 'some-suse-box'
|
||||
config.cache.enable :zypper
|
||||
end
|
||||
```
|
||||
|
||||
Used by SuSE guests, will get configured under guest's `/var/cache/zypp/packages`. It will
|
||||
also [make sure](lib/vagrant-cachier/bucket/zypper.rb#L20) that `keep-packages` is enabled
|
||||
for all repositories.
|
||||
|
|
|
@ -17,7 +17,7 @@ vagrant plugin install vagrant-cachier
|
|||
|
||||
## Quick start
|
||||
|
||||
The easiest way to set things up is just to enable [cache buckets auto detection](config/auto-detection)
|
||||
The easiest way to set things up is just to enable [cache buckets auto detection](usage)
|
||||
from within your `Vagrantfile`:
|
||||
|
||||
```ruby
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# Usage
|
||||
|
||||
## Configurations
|
||||
|
||||
### Auto detect supported cache buckets
|
||||
## Auto detect supported cache buckets
|
||||
|
||||
This is the easiest way to get started with plugin. By adding the code below to
|
||||
your `Vagrantfile` you can enable automatic detection of supported cache _buckets_:
|
||||
|
@ -17,7 +15,22 @@ end
|
|||
This will make vagrant-cachier do its best to find out what is supported on the
|
||||
guest machine and will set buckets accordingly.
|
||||
|
||||
### Cache scope
|
||||
## Enable buckets as needed
|
||||
|
||||
If for whatever reason you need to have a fined grained control over what buckets
|
||||
are configured, you can do so by "cherry picking" them on your `Vagrantfile`:
|
||||
|
||||
```ruby
|
||||
Vagrant.configure("2") do |config|
|
||||
config.cache.enable :apt
|
||||
config.cache.enable :gem
|
||||
end
|
||||
```
|
||||
|
||||
_Please refer to the "Available Buckets" menu above to find out which buckets
|
||||
are supported._
|
||||
|
||||
## Cache scope
|
||||
|
||||
By default downloaded packages will get stored on a folder scoped to base boxes
|
||||
under your `$HOME/.vagrant.d/cache`. The idea is to leverage the cache by allowing
|
||||
|
|
Loading…
Reference in a new issue