From 00f4aaa28ca8c12824cd10e6bdfce26001a9f634 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Sat, 7 Dec 2013 03:43:37 -0200 Subject: [PATCH] docs for buckets --- docs/buckets/apt-cacher.md | 29 +++++++++++++++++++++++++++++ docs/buckets/apt.md | 14 ++++++++++++++ docs/buckets/chef.md | 11 +++++++++++ docs/buckets/composer.md | 11 +++++++++++ docs/buckets/npm.md | 16 ++++++++++++++++ docs/buckets/pacman.md | 10 ++++++++++ docs/buckets/rubygems.md | 14 ++++++++++++++ docs/buckets/rvm.md | 14 ++++++++++++++ docs/buckets/yum.md | 12 ++++++++++++ docs/buckets/zypper.md | 12 ++++++++++++ docs/template.html | 5 +++++ 11 files changed, 148 insertions(+) create mode 100644 docs/buckets/apt-cacher.md create mode 100644 docs/buckets/apt.md create mode 100644 docs/buckets/chef.md create mode 100644 docs/buckets/composer.md create mode 100644 docs/buckets/npm.md create mode 100644 docs/buckets/pacman.md create mode 100644 docs/buckets/rubygems.md create mode 100644 docs/buckets/rvm.md create mode 100644 docs/buckets/yum.md create mode 100644 docs/buckets/zypper.md diff --git a/docs/buckets/apt-cacher.md b/docs/buckets/apt-cacher.md new file mode 100644 index 0000000..440b2e4 --- /dev/null +++ b/docs/buckets/apt-cacher.md @@ -0,0 +1,29 @@ +# APT-CACHER + +```ruby +Vagrant.configure("2") do |config| + config.vm.box = 'some-debian-box' + config.cache.enable :apt_cacher +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) + + # install apt-cacher on (Host)-VM + $ sudo apt-get install apt-cacher-ng + + # get the IP for eth0 interface + $ ifconfig eth0 |grep "inet addr"|awk '{print $2}' |cut -c6-20 + + # configure mirror on for your docker/LXC instances: + $ echo 'Acquire::http { Proxy "http://X.X.X.X:3142"; };' > /etc/apt/apt.conf.d/10mirror + + # 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`. + diff --git a/docs/buckets/apt.md b/docs/buckets/apt.md new file mode 100644 index 0000000..780892b --- /dev/null +++ b/docs/buckets/apt.md @@ -0,0 +1,14 @@ +# APT + +```ruby +Vagrant.configure("2") do |config| + config.vm.box = 'some-debian-box' + config.cache.enable :apt +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_ diff --git a/docs/buckets/chef.md b/docs/buckets/chef.md new file mode 100644 index 0000000..2ead6e9 --- /dev/null +++ b/docs/buckets/chef.md @@ -0,0 +1,11 @@ +# Chef + +```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+. diff --git a/docs/buckets/composer.md b/docs/buckets/composer.md new file mode 100644 index 0000000..33f229d --- /dev/null +++ b/docs/buckets/composer.md @@ -0,0 +1,11 @@ +# [Composer](http://getcomposer.org/) + +```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. diff --git a/docs/buckets/npm.md b/docs/buckets/npm.md new file mode 100644 index 0000000..fadca00 --- /dev/null +++ b/docs/buckets/npm.md @@ -0,0 +1,16 @@ +# [npm](https://npmjs.org/) + +```ruby +Vagrant.configure("2") do |config| + config.vm.box = 'some-box-with-nodejs-installed' + config.cache.enable :npm +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. diff --git a/docs/buckets/pacman.md b/docs/buckets/pacman.md new file mode 100644 index 0000000..6393d63 --- /dev/null +++ b/docs/buckets/pacman.md @@ -0,0 +1,10 @@ +# Pacman + +```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`. diff --git a/docs/buckets/rubygems.md b/docs/buckets/rubygems.md new file mode 100644 index 0000000..7f58cb4 --- /dev/null +++ b/docs/buckets/rubygems.md @@ -0,0 +1,14 @@ +# RubyGems + +```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. diff --git a/docs/buckets/rvm.md b/docs/buckets/rvm.md new file mode 100644 index 0000000..e244309 --- /dev/null +++ b/docs/buckets/rvm.md @@ -0,0 +1,14 @@ +# [rvm](https://rvm.io/) + +```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. diff --git a/docs/buckets/yum.md b/docs/buckets/yum.md new file mode 100644 index 0000000..4b3182b --- /dev/null +++ b/docs/buckets/yum.md @@ -0,0 +1,12 @@ +# Yum + +```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`. diff --git a/docs/buckets/zypper.md b/docs/buckets/zypper.md new file mode 100644 index 0000000..7c8131f --- /dev/null +++ b/docs/buckets/zypper.md @@ -0,0 +1,12 @@ +# Zypper + +```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. diff --git a/docs/template.html b/docs/template.html index 5cc5b97..6c8ee0e 100644 --- a/docs/template.html +++ b/docs/template.html @@ -44,6 +44,11 @@ .navbar-nav>li>iframe { margin-top: 12px; } + + table { + margin-left: auto; + margin-right: auto; + }