forked from etcd-io/etcd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Vagrantfile): Add Vagrantfile for easy start
- Loading branch information
Showing
4 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
/machine* | ||
/bin | ||
/src | ||
.vagrant |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Development tools | ||
|
||
## Vagrant | ||
|
||
For fast start you can use Vagrant. `vagrant up` will make etcd build and running on virtual machine. Required Vagrant version is 1.5.0. | ||
|
||
Next lets set a single key and then retrieve it: | ||
|
||
``` | ||
curl -L http://127.0.0.1:4001/v2/keys/mykey -XPUT -d value="this is awesome" | ||
curl -L http://127.0.0.1:4001/v2/keys/mykey | ||
``` |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
# | ||
Vagrant.require_version '>= 1.5.0' | ||
Vagrant.configure("2") do |config| | ||
config.vm.box = "precise64" | ||
config.vm.box_url = "http://files.vagrantup.com/precise64.box" | ||
|
||
config.vm.network :forwarded_port, host: 4001, guest: 4001 | ||
config.vm.network :forwarded_port, host: 7001, guest: 7001 | ||
|
||
# Fix docker not being able to resolve private registry in VirtualBox | ||
config.vm.provider :virtualbox do |vb, override| | ||
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] | ||
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"] | ||
end | ||
|
||
config.vm.provision "docker" do |d| | ||
d.build_image "/vagrant", args: '-t etcd' | ||
d.run "etcd", args: "-p 4001:4001 -p 7001:7001", demonize: true | ||
end | ||
|
||
# plugin conflict | ||
if Vagrant.has_plugin?("vagrant-vbguest") | ||
config.vbguest.auto_update = false | ||
end | ||
end |