본 글에서는 Packer에 대한 간단한 소개 및 설치 방법에 대해서 알아본다.
Packer는 Hashicorp사에서 제공하는 오픈소스 도구이다. 이를 이용하여 사용자는 멀티 클라우드 플랫폼에서 동일한 머신 이미지(서버 이미지) 생성을 자동화할 수 있다.
한마디로 "골든 이미지"를 만들기 위해 자동화 도구이다.
Packer를 설치하는 방법에 대해서 소개한다. Packer는 다음과 같은 3가지 방식에 대한 설치를 제공한다.
Using a precompiled binary. We release binaries for all supported platforms and architectures. This method is recommended for most users. (권장)
Installing from source. This method is only recommended for advanced users.
Using your system's package manager. (본 글에서 사용)
필자는 편의상 WSL 환경에서 APT를 사용하여 설치해보았다.
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
[sudo] password for hyungwook:
OK
hyungw
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
...
Fetched 3729 kB in 7s (542 kB/s)
Reading package lists... Done
sudo apt-get update && sudo apt-get install packer
...
Preparing to unpack .../packer_1.7.10_amd64.deb ...
Unpacking packer (1.7.10) ...
정상적으로 설치되었는지 확인해보자.
새 명령 프롬프트 또는 콘솔을 열고 packer
명령으로 확인해본다.
packer
Usage: packer [--version] [--help] <command> [<args>]
Available commands are:
build build image(s) from template
console creates a console for testing variable interpolation
fix fixes templates from old versions of packer
fmt Rewrites HCL2 config files to canonical format
hcl2_upgrade transform a JSON template into an HCL2 configuration
init Install missing plugins or upgrade plugins
inspect see components of a template
validate check that a template is valid
version Prints the Packer version
간략한 소개 및 설치 방법에 대해서 알아보았다.
다음 글에서는 Packer를 사용하여 AWS AMI를 생성하는 방법에 알아볼 예정이다.