본문 바로가기

맥(솔라리스)

macOS(Big Sur)에 Packer 설치

반응형

macOS(Big Sur)에 Packer 설치

packer 다운로드

https://www.packer.io/downloads

p1

packer 설치

brew tap hashicorp/tap
brew install hashicorp/tap/packer
> brew tap hashicorp/tap
Updating Homebrew...
==> Homebrew was updated to version 3.2.6
The changelog can be found at:
  https://github.com/Homebrew/brew/releases/tag/3.2.6

> brew install hashicorp/tap/packer
==> Installing packer from hashicorp/tap
==> Downloading https://releases.hashicorp.com/packer/1.7.4/packer_1.7.4_darwin_amd64.zip
######################################################################## 100.0%
🍺  /usr/local/Cellar/packer/1.7.4: 3 files, 161.4MB, built in 15 seconds

packer 버전 확인

packer --version
> packer --version
1.7.4
728x90

packer 사용법

> packer --help                                                                                                           
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
    plugins         Interact with Packer plugins and catalog
    validate        check that a template is valid
    version         Prints the Packer version

주요 명령어

플러그인 설치 또는 플러그인 업그레이드

packer init .

템플릿 유효성 확인

packer validate .

HCL2 구성 파일로 다시 작성

packer fmt .

이미지 빌드

packer build .

 

참고URL

- https://learn.hashicorp.com/tutorials/packer/get-started-install-cli

 

728x90
반응형