How to use this box with Vagrant:
Vagrant.configure("2") do |config|
config.vm.box = "yungsang/boot2docker"
config.vm.box_version = "0.9.3"
end
vagrant init yungsang/boot2docker \
--box-version 0.9.3
vagrant up
This version was created about 10 years ago.
Cf.) https://github.com/YungSang/boot2docker-vagrant-box
/etc/resolv.conf in the VM, please refer to https://github.com/YungSang/boot2docker-vagrant-box/issues/1.VAGRANTFILE_API_VERSION = "2"
Vagrant.require_version ">= 1.6.3"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "yungsang/boot2docker"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.synced_folder ".", "/vagrant", 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 :docker do |d|
d.pull_images "google/busybox"
d.run "simple-echo",
image: "google/busybox",
args: "-p 8080:8080",
cmd: "nc -p 8080 -l -l -e echo hello world!"
end
config.vm.network :forwarded_port, guest: 8080, host: 8080
end
Cf.) https://gist.github.com/YungSang/9183913
$ vagrant init yungsang/boot2docker
$ vagrant up
$ docker version
$ docker images
$ docker ps
$ nc localhost 8080
hello world!
I've dropped a box for Parallels from here. Instead, you can use parallels/boot2docker here.