Created
February 2, 2015 16:38
-
-
Save i0n/ddacd528b6b75e2d2e4f to your computer and use it in GitHub Desktop.
Vagrant docker host proxy Vagrantfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.require_version ">= 1.6.3" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.provider "virtualbox" do |v| | |
v.memory = 1024 | |
end | |
config.vm.define "docker-vagrant" | |
config.vm.box = "hashicorp/precise64" | |
config.vm.provision "docker" do |d| | |
d.version = "1.3.3" | |
end | |
config.vm.provision "shell", inline: "ps aux | grep 'sshd:' | awk '{print $2}' | xargs kill" | |
config.vm.network "private_network", ip: "172.17.8.101" | |
# Uncomment below to use more than one instance at once | |
# config.vm.network :forwarded_port, guest: 2375, host: 2375, auto_correct: true | |
# 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 | |
# cd /usr/local/bin | |
# sudo wget http://dl.bintray.com/mitchellh/packer/packer_0.7.5_linux_amd64.zip | |
# sudo unzip packer_0.7.5_linux_amd64.zip | |
# sudo rm packer_0.7.5_linux_amd64.zip | |
# EOT | |
#end | |
config.vm.synced_folder "~", "/user", id: "user", :nfs => true, :mount_options => ['nolock,vers=3,udp'] | |
config.vm.network :forwarded_port, guest: 2375, host: 2375 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment