2. Agenda
● About me
● Introduction to Packer
● Building Linux AMI
● Building Windows AMI
● Golden-Image pipeline using native AWS tools
● Q & A
3. About me
Marek Piątek
● I enjoy working with public cloud and
automation (Python, Ansible, Docker)
● I have all professional AWS and Azure
certification
Currently:
Technical Lead in Cloud CCoE @DNB
We are hiring!
Hobbies:
snowboarding, kitesurfing.
@piontas
7. ”Pre-baked machine images have a lot of advantages, but
most have been unable to benefit from them because
images have been too tedious to create and manage.”
8. Advantages of using Packer
● Fast infrastructure deployment
● Multi-provider portability
● Stability
● Identicality
9. Well-known use cases
Golden Images
Secure, immutable OS images are needed
especially in Enterprise World where compliance
issues matters.
Continuous Delivery
Generate new machine images for multiple
platforms on every change to Ansible, Puppet or
Chef repositories.
Environment Parity
Keep all dev/test/prod environments as similar as
possible. No matter if you deploy to AWS or Azure
or elsewhere.
Auto-Scaling acceleration
Launch completely provisioned and configured
instances in seconds, rather than minutes or even
hours.
11. Installing Packer
Approaches to installing Packer:
● Using precompiled binaries
● Compiling, installing from sources
● Alternative installation methods like
○ Chocolatery
○ Homebrew
12. Packer Commands (CLI)
All interaction with Packer is done via the packertool.
Available Packer Commands:
● build
● fix
● inspect
● push
● validate
13. Packer Templates
The JSON configuration files used to define/describe images.
Templates are divided into core sections:
● variables (optional)
● builders (required)
● provisioners (optional)
● post-processors (optional)
14. Builders
Builders are responsible for creating machines
and generating images for various platforms.
Popular supported builders by Packer:
● Amazon EC2
● Azure
● Google Cloud
● OpenStack
● VirtualBox
● Docker
● Hyper-V
15. Provisioners
Provisioners are responsible for preparing and
configuring the operating system.
Popular supported provisioners by Packer:
● Ansible
● Puppet
● Chef
● Salt
● Shell
● PowerShell