Last active
September 5, 2024 22:33
-
-
Save YungSang/60fb7d026692e4754123 to your computer and use it in GitHub Desktop.
Docker Provider VS Docker Provisioner
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
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.define "boot2docker", autostart: false do |b2d| | |
b2d.vm.box = "yungsang/boot2docker" | |
b2d.nfs.functional = false | |
b2d.vm.network :forwarded_port, guest: 8080, host: 8080 | |
end | |
config.vm.define "hello-world", primary: true do |v| | |
v.vm.provider "docker" do |d| | |
d.vagrant_vagrantfile = "./Vagrantfile" | |
d.vagrant_machine = "boot2docker" | |
d.image = "yungsang/busybox" | |
d.name = "hello-world" | |
d.ports = ["8080:80"] | |
d.cmd = ["nc", "-p", "80", "-l", "-l", "-e", "echo", "hello world!"] | |
end | |
end | |
end |
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
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.define "hello-world" | |
config.vm.box = "boot2docker" | |
config.vm.network :forwarded_port, guest: 8080, host: 8080 | |
config.vm.provision :docker do |d| | |
d.run "hello-world", | |
image: "yungsang/busybox", | |
args: "-p 8080:80", | |
cmd: "nc -p 80 -l -l -e echo hello world!" | |
end | |
end |
Author
YungSang
commented
Jul 17, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment