dockopk.blogg.se

Vagrant base box
Vagrant base box











vagrant base box

So for instance, if I am interested to repackage VM Node_default_1387087098 then I will run, vagrant package -base Node_default_1387087098 -output /myfolder/precise64Node.box Once you have specific name for VM which you want to repackage, you can run vagrant package -base SPECIFIC_NAME_FOR_VM -output /yourfolder/OUTPUT_BOX_NAME.box For example following image illustrate two VM running under VirtualBox Node_default_1387087098 and Blogs_default_1386384681 If you are using VirtualBox as provider you can see a list of virtual machine with their specific machine. Also repackaging allows me to work offline as no provisioning is required.įirst step is to get id or specific name of VM from your Vagrant provider.

vagrant base box

Once install/update is finished, sometime I prefer to repackage updated virtual machine as a new base box to avoid repeating the install and update process. Then using either Puppet provisioner or apt-get I normally install/update required packages and libraries in my VM.

vagrant base box

With help of a Vagrant provider vagrant up will create a virtual machine (VM) using specified base box.

vagrant base box

So exit the VM using the command exit ,open the vagrant file in any text editor and then un-comment the following line by removing the # symbol and save it.Typically my Vagrant workflow starts with a official base box provided by Ubuntu. To access the web server from the host (laptop or physical machine), we need to map VM’s port to host’s port in the vagrantfile. The apache2 web server is listening on port 80 on the VM. This is a not a command but a feature to map VM’s port to host’s port. For this tutorial, let’s install apache2 web server sudo -i // change to root user apt-get -y update & apt-get install -y apache2 4. After login, you can install any software like web server or database etc. This command will let you login into the VM with the default credentials via secure shell (ssh). It will pull the box specified in the vagrantfile from Vagrant cloud and starts the machine. Now run the command vagrant up to initialize the VM. but for this tutorial we will not do that. You can also change the network settings, increase RAM etc.













Vagrant base box