Build CentOS 7 Vagrant Box with Packer.
- Install VirtualBox
- Install Vagrant
- Install Packer
- Download the CentOS 7 NetInstall ISO and copy/link it into the repo directory, or auto download from ISO mirror
cd vagrant-centos
packer build centos7.json
User Variable | Default Value | Description |
---|---|---|
disk_size |
40000 | Documentation |
headless |
false | Documentation |
memory |
512 | Memory size in MB |
mirror |
A URL of the ISO mirror, default use local ISO, eg: http://mirrors.kernel.org/centos/7.2.1511/isos/x86_64/ |
|
ssh_timeout |
1800s | SSH connect timeout |
packer build -var headless=true -var disk_size=100000 base/centos7.json
# create box version and provider
./make.sh create -v 0.2.0
# upload box file
./make.sh upload -v 0.2.0 -f build/centos-7-x86_64-virtualbox.box
# release box
./make.sh release -v 0.2.0
# get box
vagrant init lostsnow/centos7
# or
vagrant box add lostsnow/centos7 build/centos-7-x86_64-virtualbox.box
vagrant up
vagrant ssh