测试使用Docker

Web
Rykka at 2015/04/02

本文地址:http://rykka.me/ce-shi-shi-yong-docker.html

Homebrew ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

Cask brew tap caskroom/homebrew-cask brew install brew-cask

Vagrant and Virtualbox brew cask install virtualbox brew cask install vagrant

We should define the proxy VM vagrant file also with the docker container vagrant file

proxy:

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "hashicorp/precise64"
  config.vm.provision "docker"
  config.vm.provision "shell", inline:
    "ps aux | grep 'sshd:' | awk '{print $2}' | xargs kill"

  config.vm.network :forwarded_port, guest: 6379, host: 6379
  config.vm.network :forwarded_port, guest: 5432, host: 5432
  config.vm.network :forwarded_port, guest: 9200, host: 9200
end