• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Search

Terraform in a Docker Container

July 17, 2021

Run Terraform in a Docker container.

docker run --rm -it --name terraform -v ~/.aws:/root/.aws -v $(pwd):/workspace -w /workspace hashicorp/terraform:latest

docker run --rm -it --name terraform -v ~/.aws:/root/.aws -v $(pwd):/workspace -w /workspace hashicorp/terraform:latest

Create an alias.

alias terraform='docker run --rm -it --name terraform -v ~/.aws:/root/.aws -v $(pwd):/workspace -w /workspace hashicorp/terraform:latest'

alias terraform='docker run --rm -it --name terraform -v ~/.aws:/root/.aws -v $(pwd):/workspace -w /workspace hashicorp/terraform:latest'

Run the command

terraform --version
Terraform v1.0.2
on linux_amd64

terraform --version Terraform v1.0.2 on linux_amd64

Filed Under: Cloud Tagged With: container, docker, run, terraform

Subscribe Via Email

  • Home
  • About
  • Search

Copyright © 2023