But how do you know what boxes are available and how to specify them? So, as you may imagine, every Vagrant development environment requires you to specify a base image - what Vagrant calls a “box”, and what is specified as “ubuntu/bionic64” in the configuration we are using here. We then end the config block with the Ruby end statement. In our case, we have only one configuration parameter, called box, for which we’ve specified "ubuntu/bionic64". The first line of our distilled version tells Vagrant to use version 2 configuration ( nfigure("2")), and to proceed with iterating through the configuration parameters for the virtual machine ( do |config|) specified in the format config.vm.PARAMETER, where PARAMETER is just a generic placeholder for any of a number of documented machine settings. Any of the other lines, starting with a hash ( #), are considered commments. This is a distillation of the entire default file. This default file Vagrant creates is very well-documented, and worth reading through to get familiar with the various configuration options.įor our purposes here, we are primarily concerned with the following three lines: nfigure("2") do |config| So, when we do an init, like with did with vagrant init ubuntu/bionic64, Vagrant creates this file for us if it does not already exist. It should be simply named “ Vagrantfile” without any file extension. VagrantfileĮverything Vagrant does centers around this file. And by default it is stored in the current working directory - the directory from which you run vagrant init. But what is that exactly? And where is it stored? The answer is: The Vagrantfile. I mentioned that this creates a basic configuration. If you recall from that previous post, we initialized a VM using Vagrant’s init command. In this post, we’ll cover in a bit more depth how to define virtual machines in Vagrant using a Vagrantfile. In my previous post, I discussed what Vagrant is, some details about getting it installed, and then the structure of a basic Vagrant deployment.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |