Please enable JavaScript.
Coggle requires JavaScript to display documents.
VAGRANT (GETTING STARTED (Networking (load http://127.0.0.1:4567 in…
VAGRANT
INTRODUCTION
-
Why
Vagrant provides easy to configure, reproducible, and portable work environments.
Work well at VirtualBox, VMware, AWS
provides the provisioning tools such as shell scripts, Chef, or Puppet, can automatically install and configure software on the virtual machine
help all team member can run code in the same environment, dependencies, all configuration.
vs OTHER SOFTWARE
CLI Tools
Vagrant builds on top of command line utilities in a number of ways while still providing a consistent workflow
Docker
-
-
Docker is a container management that can consistently run software as long as a containerization system exists
-
GETTING STARTED
Networking
-
-
-
Edit Vagrantfile
config.vm.network :
forwarded_port, guest: 80, host: 4567
Provisioning
-
edit Vagrantfile
config.vm.provision :shell, path: "bootstrap.sh"
create the shell script file( example bootstrap.sh)
#!/usr/bin/env bash
apt-get update
apt-get install -y apache2
if ! [ -L /var/www ]; then
rm -rf /var/www
ln -fs /vagrant /var/www
fi
-
Synced Folders
the Vagrant project directory( which contain Vagrantfile ) is shared with /vagrant directory in guest machine
-
-
-
Project Setup
-
Create a Vagrantfile first.
It contains the kind of machine,
resources, software to install,
how to access it
-
-
-
-