More Docker. Easy Access. New Streamlined Plans. Learn more.

hashicorp/terraform

Verified Publisher

By HashiCorp, Inc.

Updated 7 days ago

Automatic builds of Terraform. See README for more use and info.

Image
Artifact
Developer Tools
491

100M+

Terraform

Terraform is an infrastructure as code (IaC) tool that allows you to build, change, and version infrastructure safely and efficiently. This includes low-level components such as compute instances, storage, and networking, as well as high-level components such as DNS entries, SaaS features, etc. Terraform can manage both existing service providers and custom in-house solutions.

Running Terraform inside a Docker container requires more configuration than running the Terraform CLI executables directly. Unless you need container isolation, we recommend using the non-containerized Terraform CLI packages.

Terraform Docker Images

The Terraform team publishes a Docker image to this repository for each official release of Terraform CLI. Each versioned image includes the Terraform CLI release with the same version number.

These images wrap the terraform executable, allowing you to run Terraform subcommands by passing in their names and arguments as part of docker run. For example, the command below uses the 'latest' tag to generate a plan using the most recent version of Terraform:

docker run -i -t hashicorp/terraform:latest plan

Note that for production use, we recommend specifying a specific version instead of using latest.

Configuration

You will likely need to further configure your container so that Terraform can access your configuration files and provider credentials. This could include mounting your configuration into the container, setting the working directory to refer to your configuration, and passing in environment variables and credentials files for the providers you intend to use. The docker run documentation lists the options you can use to customize the container environment. You could also use these images as a base for your own images. For example, this would be helpful if you wanted to to pre-set CLI Configuration settings as part of your image.

Community

Open issues about the Terraform docker images in the main Terraform repository.

Docker Pull Command

docker pull hashicorp/terraform