Code Monkey home page Code Monkey logo

packer_templates's Introduction

Packer Templates

A collection of Packer Tempaltes to build "Golden images" of various OSes

All Packer templates are basked on the templates used in the Bento project by Chef Software and have been modifed for my own personal use and not intended for building Vagrant base boxes, for vagrant boxes see the templates in the [project home](https://github.com/chef/bento and the ones published on the bento org on Vagrant Cloud.

Building Virtual Machine images

Requirements

Using packer

To build an Ubuntu 20.04 box for only the Vmware provider

$ cd packer_templates/ubuntu
$ packer build -only=vmware-iso ubuntu-20.04-amd64.json

To build an Ubuntu 18.04 box for only the VirtualBox provider

$ cd packer_templates/ubuntu
$ packer build -only=virtualbox-iso ubuntu-18.04-amd64.json

To build Debian 10.4 32bit boxes for all possible providers (simultaneously)

$ cd packer_templates/debian
$ packer build debian-10.4-i386.json

To build CentOS 7.7 boxes for all providers except VMware and Parallels

$ cd packer_templates/centos
$ packer build -except=parallels-iso,vmware-iso centos-7.7-x86_64.json

To use an alternate mirror

$ cd packer_templates/fedora
$ packer build -var 'mirror=http://mirror.utexas.edu/fedora/linux' fedora-31-x86_64.json

To use a designated packer cache, create a folder and set the environmental variable

$ mkdir /path/to/store/isodownload
$ PACKER_CACHE_DIR=/path/to/store/isodownload
$ cd packer_templates/fedora
$ packer build -only=vmware-iso fedora-31-x86_64.json

Configuring Packer logging

Packer depends on two environment variables being configured, PACKER_LOG and PACKER_LOG_PATH

$ export PACKER_LOG=1
$ export PACKER_LOG_PATH="packerlog.txt"
$ packer build -only=vmware-iso alpine-3.12-x86.json
$ tail -f packerlog.txt

If the build is successful, the Virtual Machine files will be in the builds directory at the root of the repository.

CENTOS/RHEL/ORACLE Linux type OSes

CENTOS, RHEL and ORACLE Linux share the same kickstart, ks.cfg, and build scripts found in the centos folder. These scripts set the hostname to newvm, so rename and adjust accordingly per build

Proprietary Templates

Templates for operating systems (macOS, Red Hat Enterprise Linux, and SUSE Linux Enterprise) that require license or subscription require you to add the correct links to the ISOs as they are not publicly available

The Packer templates expect the ISOs to be in ./packer_cache folder relative to the Packer .json file

Other helpful resources and troubleshooting tips

See links below

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.