背景
Why?
インフラの構築作業を自働化したい
How?
ミドルウェアのレイヤーを対象とし、Chefを利用して実装する
What?
何度も繰り返し構築と破壊を繰り返せる開発環境を用意する
作業環境
software | version |
---|---|
Mac OS X | 10.8.4 |
zsh | 4.3.11 (i386-apple-darwin12.0) |
git | 1.7.12.4 (Apple Git-37) |
VirtualBox | 4.2.16-86992 |
rbenv | 0.4.0-51-ga2adc61 |
ruby | 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.1] |
bundler | 1.3.5 |
vagrant | 1.2.7 |
docker | 0.5.3 |
rbenv plugins | github |
---|---|
rbenv-binstubs | https://github.com/ianheggie/rbenv-binstubs.git |
rbenv-gem-rehash | https://github.com/sstephenson/rbenv-gem-rehash.git |
rbenv-gemset | https://github.com/jf/rbenv-gemset.git |
ruby-build | https://github.com/sstephenson/ruby-build.git |
.zshrc
# Source User definitions
if [ -d $HOME/.rbenv/bin ]; then
export PATH="$HOME/.rbenv/bin:./.bundle/bin:$PATH"
eval "$(rbenv init -)"
fi
1. VirtualBox のインストール
上記サイトからバイナリパッケージをダウンロードして実行する
- VirtualBox platform packages
- VirtualBox xx.xx.xx Oracle VM VirtualBox Extension Pack ( xx.xx.xx はバージョン )
2. vagrant のインストール
Gemfile
source "https://rubygems.org"
gem 'vagrant', :git => 'https://github.com/mitchellh/vagrant',
:tag => 'v1.2.7'
bundle install --path vendor/bundle --binstubs .bundle/bin
source ~/.zshrc
3. docker のインストール
git clone https://github.com/dotcloud/docker.git .docker
4. docker の起動
cd .docker
vagrant up
vagrant ssh
vagrant@precise64:~$ which docker
/usr/bin/docker
exit
vagrant halt
docker を起動して、そのまま利用するのであればとりあえずここまで
5. Dockerfile
仮想サーバのOSなどを指定する
Todo : そのうち書く