Dongri's Blog - docker-sharing 用の Vagrantfile はこんな感じでどうでしょうか?
Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "boot2docker"
config.vm.box = "yungsang/boot2docker"
config.vm.network :forwarded_port, guest: 2375, host: 4243, disabled: true
config.vm.network :private_network, ip: "192.168.33.10"
config.vm.synced_folder ".", "/var/app", type: "nfs"
# Fix busybox/udhcpc issue
config.vm.provision :shell do |s|
s.inline = <<-EOT
if ! grep -qs ^nameserver /etc/resolv.conf; then
sudo /sbin/udhcpc
fi
cat /etc/resolv.conf
EOT
end
# Adjust datetime after suspend and resume
config.vm.provision :shell do |s|
s.inline = <<-EOT
sudo /usr/local/bin/ntpclient -s -h pool.ntp.org
date
EOT
end
config.vm.provision :shell do |s|
s.inline = <<-EOT
docker rm -f nodejs || true
EOT
end
config.vm.provision :docker do |d|
d.build_image "/var/app/node/", args: "-t dongri/node"
d.run "nodejs", image: "dongri/node", args: "-p 3000:3000"
end
config.vm.network :forwarded_port, guest: 3000, host: 3000
end
$ git clone git@github.com:dongri/Dockerfiles.git
$ cd Dockerfiles
$ edit Vagrantfile
$ vagrant up
$ open http://localhost:3000
あとはコードを修正したら vagrant provision
をやる感じで。