packer
HashiCorp Packer for building automated machine images. Use when the user needs to create AMIs, Docker images, or GCP images using HCL templates with provisioners for consistent, reproducible infrastructure images.
What this skill does
# Packer
Packer automates the creation of machine images for multiple platforms from a single source configuration.
## Installation
```bash
# Install Packer
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update && sudo apt install packer
# Verify
packer version
```
## AWS AMI Builder
```hcl
# aws-ubuntu.pkr.hcl — Build Ubuntu AMI with Nginx
packer {
required_plugins {
amazon = {
version = ">= 1.2.0"
source = "github.com/hashicorp/amazon"
}
}
}
variable "aws_region" {
type = string
default = "us-east-1"
}
variable "app_version" {
type = string
}
source "amazon-ebs" "ubuntu" {
ami_name = "app-{{timestamp}}"
instance_type = "t3.medium"
region = var.aws_region
source_ami_filter {
filters = {
name = "ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*"
root-device-type = "ebs"
virtualization-type = "hvm"
}
most_recent = true
owners = ["099720109477"]
}
ssh_username = "ubuntu"
tags = {
Name = "app-${var.app_version}"
Environment = "production"
Builder = "packer"
}
}
build {
sources = ["source.amazon-ebs.ubuntu"]
provisioner "shell" {
inline = [
"sudo apt-get update",
"sudo apt-get install -y nginx curl jq",
"sudo systemctl enable nginx"
]
}
provisioner "file" {
source = "files/nginx.conf"
destination = "/tmp/nginx.conf"
}
provisioner "shell" {
inline = [
"sudo mv /tmp/nginx.conf /etc/nginx/sites-available/default",
"sudo nginx -t"
]
}
provisioner "shell" {
inline = ["sudo apt-get clean", "sudo rm -rf /var/lib/apt/lists/*"]
}
post-processor "manifest" {
output = "manifest.json"
strip_path = true
}
}
```
## Docker Builder
```hcl
# docker-app.pkr.hcl — Build Docker image with Packer
source "docker" "app" {
image = "python:3.12-slim"
commit = true
changes = [
"EXPOSE 8080",
"WORKDIR /app",
"CMD [\"python\", \"app.py\"]"
]
}
build {
sources = ["source.docker.app"]
provisioner "shell" {
inline = [
"pip install --no-cache-dir flask gunicorn",
"mkdir -p /app"
]
}
provisioner "file" {
source = "app/"
destination = "/app/"
}
post-processor "docker-tag" {
repository = "myregistry.com/myapp"
tags = ["latest", var.app_version]
}
post-processor "docker-push" {
login = true
login_server = "myregistry.com"
login_username = var.registry_user
login_password = var.registry_pass
}
}
```
## GCP Image Builder
```hcl
# gcp-image.pkr.hcl — Build GCP Compute Engine image
source "googlecompute" "ubuntu" {
project_id = var.gcp_project
source_image = "ubuntu-2204-jammy-v20240101"
zone = "us-central1-a"
machine_type = "e2-medium"
ssh_username = "packer"
image_name = "app-{{timestamp}}"
image_labels = {
environment = "production"
builder = "packer"
}
}
build {
sources = ["source.googlecompute.ubuntu"]
provisioner "shell" {
scripts = [
"scripts/base-setup.sh",
"scripts/install-app.sh"
]
environment_vars = [
"APP_VERSION=${var.app_version}"
]
}
provisioner "ansible" {
playbook_file = "ansible/configure.yml"
}
}
```
## Multi-Builder Template
```hcl
# multi-platform.pkr.hcl — Build for AWS and GCP simultaneously
variable "app_version" {
type = string
default = "1.0.0"
}
source "amazon-ebs" "base" {
ami_name = "app-${var.app_version}-{{timestamp}}"
instance_type = "t3.medium"
region = "us-east-1"
source_ami_filter {
filters = { name = "ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*" }
most_recent = true
owners = ["099720109477"]
}
ssh_username = "ubuntu"
}
source "googlecompute" "base" {
project_id = var.gcp_project
source_image = "ubuntu-2204-jammy-v20240101"
zone = "us-central1-a"
ssh_username = "packer"
image_name = "app-${var.app_version}-{{timestamp}}"
}
build {
sources = [
"source.amazon-ebs.base",
"source.googlecompute.base"
]
provisioner "shell" {
script = "scripts/setup.sh"
}
}
```
## Common Commands
```bash
# Validate template
packer validate .
# Build image
packer build .
packer build -var "app_version=2.0.0" aws-ubuntu.pkr.hcl
# Build specific source only
packer build -only="amazon-ebs.ubuntu" .
# Initialize plugins
packer init .
# Format HCL files
packer fmt .
# Inspect template
packer inspect .
# Debug mode
PACKER_LOG=1 packer build .
```
Related in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.