Build a Vagrant box with CoreOS
- Based on CoreOS Stable 494.5.0
- kernel v3.17.2
- etcd v0.4.6
- fleet v0.8.3
- docker v1.3.3
- coreos-cloudinit v0.10.9
- systemd 215
- Add OEM files for Vagrant and patch them
- Enable the Docker daemon
- Open the official IANA registered Docker port 2375
- Add
docker-enter
(docker-attach
) script to usensenter
easily
$ make
$ vagrant box add coreos coreos.box
$ vagrant init coreos
$ vagrant up
Or
VAGRANTFILE_API_VERSION = "2"
Vagrant.require_version ">= 1.5.0"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "yungsang/coreos"
config.vm.network "forwarded_port", guest: 2375, host: 2375
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.synced_folder ".", "/home/core/vagrant", id: "core", type: "nfs", mount_options: ["nolock", "vers=3", "udp"]
config.vm.provision :docker do |d|
d.pull_images "yungsang/busybox"
d.run "simple-echo",
image: "yungsang/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
$ vagrant up
$ docker version
$ docker images -t
$ docker ps -a
$ nc localhost 8080
hello world!
To the extent possible under law, the person who associated CC0 with this work has waived all copyright and related or neighboring rights to this work.
- CoreOS is under the Apache 2.0 license?