Skip to content

koudaiii/packer_tutorial

Repository files navigation

packer_tutorial

8735x5609

Manual run in local

in MacOS

Install Packer

$ brew tap hashicorp/tap
$ brew install hashicorp/tap/packer

Test

$ packer init
$ packer validate .
$ packer fmt
$ packer build docker-ubuntu.pkr.hcl

Set up HCP Packer

sign up HCP Pakcer and get service principals

ref https://portal.cloud.hashicorp.com/access/service-principals

# Set up service principals for hcp-packer
export HCP_CLIENT_ID=
export HCP_CLIENT_SECRET=

Set up Azure

  • Azure account
  • az and az login
  • Subscription Contributor role
  • you can get <subscription_id> below. az account show --query "{ subscription_id: id }" -o json | jq -r .subscription_id
$ cd hcp-packer-ubuntu22-base
$ script/setup-hcp-packer

Build

$ cd hcp-packer-ubuntu22-base
$ packer validate .
$ packer fmt .
$ packer build .

About

hcp packer on azure using GitHub Actions

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published