Skip to content

dmitrytokarev/packer-centos-dev-box

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Packer builds VM images automatically

Packer is an open source tool for creating identical machine images for multiple platforms from a single source configuration. Packer is lightweight, runs on every major operating system, and is highly performant, creating machine images for multiple platforms in parallel. Packer does not replace configuration management like Chef or Puppet. In fact, when building images, Packer is able to use tools like Chef or Puppet to install software onto the image.

A machine image is a single static unit that contains a pre-configured operating system and installed software which is used to quickly create new running machines. Machine image formats change for each platform. Some examples include AMIs for EC2, VMDK/VMX files for VMware, OVF exports for VirtualBox, etc.

Requirements:

Install packer

To build VirtualBox images install VirtualBox

To build VMware images host must be running:

Templates

TODO: describe Packer template structure, user variables, var-files, user must provide their own iso_url

https://www.packer.io/docs/templates/user-variables.html

https://www.packer.io/docs/templates/index.html#template-structure

https://hodgkins.io/best-practices-with-packer-and-windows --- Packer best practices

Validate

Validate Packer json template:

packer validate --var-file=vars/centos_7_desktop.json centos_base.json

Build

NOTE: before building update iso path in the Packer template files (centos_6_desktop.json, centos_6_server.json).

Build VirtualBox image only (docs):

packer build --only=vbox --var-file=vars/centos_7_desktop.json centos_base.json

Build VMware image only (docs):

packer build --only=vmware --var-file=vars/centos_7_desktop.json centos_base.json

Build all image types (runs in parallel):

packer build --var-file=vars/centos_7_desktop.json centos_base.json

Use -force option to overwrite existing artifacts:

packer build -force --var-file=vars/centos_7_desktop.json centos_base.json

Build base and provisioned images just with 2 commands:

packer build -force --only=vbox --var-file=vars/centos_7_server.json centos_base.json
packer build -force --only=vbox --var-file=vars/centos_7_server.json centos_provision.json

More build options

Docs

Packer docs are short and to the point! Please read them first before contributing.

Examples

https://blog.codeship.com/packer-vagrant-tutorial/ https://github.com/geerlingguy/packer-centos-7/blob/master/Vagrantfile https://github.com/boxcutter/centos https://github.com/hfm/packer-centos-7 https://www.packer.io/docs/post-processors/vagrant.html

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages