Files
nexus/wiki/concepts/Packer.md
2026-04-18 17:09:43 +08:00

42 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
id: Packer
title: "Packer"
type: concept
tags:
- DevOps
- IaC
- AMI
- AWS
last_updated: 2026-04-18
---
## Aliases
- HashiCorp Packer
## Summary
- **定义**HashiCorp 开发的开源工具通过模板定义自动构建机器镜像AMI、VMDK、QCOW2 等)
- **用途**:实现基础设施的不可变部署
- **云迁移价值**:标准化镜像构建,确保环境一致性
## Key Details
- **核心功能**
- 多平台镜像构建AWS AMI、VMware、Vagrant、Docker 等)
- JSON/HCL 模板定义
- 预置和后置配置脚本
- 并行构建加速
- **工作流程**
1. 定义模板Builder 配置)
2. 运行 provisioner配置脚本
3. 输出镜像
- **与 Terraform 集成**
- Packer 构建 AMI
- Terraform 使用 AMI 部署基础设施
## Octane Hub 案例
- Octane Hub 使用 Packer 构建自定义 AMI
- 从手动控制台脚本演进到自动化镜像构建
## Connections
- [[Terraform]] ← uses_ami_from ← [[Packer]]
- [[Infrastructure-as-Code-IaC]] ← implementd_by ← [[Packer]]
- [[AMI]] ← built_by ← [[Packer]]