Skip to content

Instantly share code, notes, and snippets.

@nobiki
Last active April 27, 2018 05:37
Show Gist options
  • Save nobiki/857c8c2be4a4edfb7e80698854add3bb to your computer and use it in GitHub Desktop.
Save nobiki/857c8c2be4a4edfb7e80698854add3bb to your computer and use it in GitHub Desktop.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# A dummy plugin for Barge to set hostname and network correctly at the very first `vagrant up`
module VagrantPlugins
module GuestLinux
class Plugin < Vagrant.plugin("2")
guest_capability("linux", "change_host_name") { Cap::ChangeHostName }
guest_capability("linux", "configure_networks") { Cap::ConfigureNetworks }
end
end
end
Vagrant.configure(2) do |config|
config.vm.define "barge"
config.vm.box = "ailispaw/barge"
config.disksize.size = '80GB'
config.vm.synced_folder ".","/vagrant"
config.vm.provision :docker do |d|
d.pull_images "busybox"
d.run "simple-echo",
image: "busybox",
args: "-p 8080:8080 -v /usr/bin/dumb-init:/dumb-init:ro --entrypoint=/dumb-init",
cmd: "nc -p 8080 -l -l -e echo hello world!"
end
config.vm.provider "virtualbox" do |vb|
vb.memory = 4096 # MB
vb.cpus = 2
vb.customize ["modifyvm", :id, "--ioapic", "on"]
end
config.vm.network :forwarded_port, guest: 8080, host: 8080
config.vm.network :forwarded_port, guest: 80, host: 80 # Web
config.vm.network :forwarded_port, guest: 3306, host: 3306 # MySQL
config.vm.network :forwarded_port, guest: 5432, host: 5432 # Postgres
config.vm.network :forwarded_port, guest: 4444, host: 4444 # Selenium(Hub)
config.vm.network :forwarded_port, guest: 5900, host: 5900 # Selenium(VNC:Chrome)
config.vm.network :forwarded_port, guest: 5901, host: 5901 # Selenium(VNC:Firefox)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment