Packer
ELI5 — The Vibe Check
Packer builds machine images (AMIs, Docker images, VM images) from code. Define what you want installed, Packer builds the golden image. Every server starts identical. No more 'this server has a slightly different Python version' nightmares. It's a factory for server blueprints.
Real Talk
HashiCorp Packer is an open-source tool for creating identical machine images for multiple platforms from a single source configuration. It supports builders for AWS, Azure, GCP, Docker, VMware, and more. Uses provisioners (shell, Ansible, Chef) to install software on temporary instances, then captures the result as an image.
Show Me The Code
packer {
required_plugins {
amazon = {
source = "github.com/hashicorp/amazon"
}
}
}
source "amazon-ebs" "ubuntu" {
ami_name = "my-app-{{timestamp}}"
instance_type = "t3.micro"
source_ami = "ami-0abcdef1234567890"
}
build {
sources = ["source.amazon-ebs.ubuntu"]
provisioner "shell" {
script = "setup.sh"
}
}
When You'll Hear This
"Packer builds our golden AMI with all dependencies pre-installed." / "We run Packer in CI — every merge to main produces a new machine image."
Related Terms
Docker
Docker is like a lunchbox for your app.
Infrastructure as Code
ClickOps means building your cloud infrastructure by clicking buttons in AWS console.
Terraform
Terraform is a tool that lets you describe your entire cloud infrastructure in code files, then type one command to make it real.
Terratest
Terratest is a Go library for testing your infrastructure code. Write Terraform? Test it with Terratest.