とりあえず手順を書く
$ cat Brewfile
install boot2docker
tap 'phinze/cask'
install brew-cask
cask install virtualbox
$ brew bundle
$ rehash
$ boot2docker init
# boot2docker の VirtualBox から ホスト側にネットワーク通す
#$ for i in {49000..49900}; do
# VBoxManage modifyvm "boot2docker-vm" --natpf1 "tcp-port$i,tcp,,$i,,$i";
# VBoxManage modifyvm "boot2docker-vm" --natpf1 "udp-port$i,udp,,$i,,$i";
#done
$ VBoxManage modifyvm "boot2docker-vm" --natpf1 "tcp-port3000,tcp,,3000,,3000";
$ boot2docker up
$ cat dockerscript.zsh
if whence -p boot2docker 2>&1 > /dev/null; then
alias boot2dockerenv="boot2docker up | awk '/export/{print \$2}'"
alias boot2dockerhost="boot2docker up | awk -F= '/export/{print \$2}'"
alias boot2dockerstatus="boot2docker status | awk '{print \$5}'"
if whence -p docker 2>&1 > /dev/null; then
function docker {
if [[ x"`boot2dockerstatus`" == x"running." ]]; then
command docker --host="`boot2dockerhost`" "$@"
else
command docker "$@"
fi
}
fi
fi
$ source dockerscript.zsh
$ docker build -t clairvy/railsgirls .
$ docker run -rm -p 3000:3000 clairvy/railsgirls