Set up a Vagrant box on macOS Si

2017-10-30  本文已影响0人  hyperRect
  1. Download Vagrant install package then install and verify.
    link: https://www.vagrantup.com/downloads.html
$ vagrant
  1. Create a directory for your vagrant box environment.
mkdir work
cd work
vagrant init
  1. Download a box template(ubuntu) from official site
$ vagrant box add hashicorp/precise64
  1. Edit Vagrantfile : set vagrant box by editing the config.
$ sudo vim Vagrantfile

**make sure this line is uncommented and the value is set for the box.

config.vm.box = "hashicorp/precise64"
config.vm.network "private_network", ip: "192.168.33.10"
  1. Vagrant Up
$ vagrant up
$ vagrant ssh

Type vagrant ssh to log in.

  1. Your ubuntu vagrant box is good to go. Install nginx or whatever you want in the box.
上一篇下一篇

猜你喜欢

热点阅读