Hashicorp

Terraform - Tutorial

I need to review Terraform sometimes, so I left a tutorial+terminology so that I can recall it quickly. Install https://www.terraform.io/downloads https://learn.hashicorp.com/tutorials/terraform/install-cli On Ubuntu 21: sudo apt-get update && sudo apt-get install -y gnupg software-properties-common curl curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add - sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" sudo apt-get update && sudo apt-get install terraform Check: ➜ terraform --version Terraform v1.1.2 on linux_amd64 Configure tab completion.

Packer - tutorial

Install https://learn.hashicorp.com/tutorials/packer/get-started-install-cli I installed pre-compiled version from the official download page (just download a binary). cd /usr/local/src sudo curl https://releases.hashicorp.com/packer/1.7.6/packer_1.7.6_linux_amd64.zip -O sudo unzip packer_1.7.6_linux_amd64.zip sudo mv packer /usr/bin/ packer version Use Build a Docker image mkdir packer_tutorial cd packer_tutorial touch docker-ubuntu.pkr.hcl In the file docker-ubuntu.pkr.hcl, we define how to set up Pakcer environment and how to build artifacts (images/containers/VMs/etc.). docker-ubuntu.pkr.hcl: packer { required_plugins { docker = { version = ">= 0.