Add Carbon Packer config
[integration/packaging.git] / rpm / Vagrantfile
index 0d400b1cbbd8caa7c43f13d4d4251f84c808a05d..cd1a2334e8616bca6ed19177b9c537ce07920b56 100644 (file)
@@ -3,15 +3,27 @@
 
 # Vagrantfile API/syntax version.
 VAGRANTFILE_API_VERSION = "2"
+BOX = "centos/7"
 
 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
-  # RPM build environment is CentOS 7
-  config.vm.box = "centos/7"
+  # Configure VM RAM and CPU for VirtualBox. Change this to meet your needs.
+  config.vm.provider :virtualbox do |virtualbox, override|
+    virtualbox.memory = 2048
+    virtualbox.cpus = 2
+    override.vm.box = BOX
+  end
 
-  # We run out of RAM once ODL starts with default 500MB
-  config.vm.provider :libvirt do |libvirt|
+  # Configure VM RAM and CPU for LibVirt. Change this to meet your needs.
+  config.vm.provider :libvirt do |libvirt, override|
     libvirt.memory = 2048
-    libvirt.cpus = 1
+    libvirt.cpus = 2
+    override.vm.box = BOX
+  end
+
+  config.vm.provider "docker" do |docker, override|
+    docker.build_dir = "."
+    docker.remains_running = false
+    override.vm.synced_folder ".", "/build"
   end
 
   # NFS is fragile, use rsync
@@ -31,7 +43,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
 
   # Install Python dependences system-wide via pip
   # NB: Could use a venv here, but since we're already in a Vagrant box and
-  # don't need any isolation more, it doesn't seem worth the extra complexity.
+  # don't need any more isolation, it doesn't seem worth the extra complexity.
   config.vm.provision "shell", inline: "pip install -r /vagrant/requirements.txt"
 
   # Add vagrant user to mock group for rpmbuild