In the previous recipes of this chapter, we discussed how to install Terraform locally, either manually or via a script, depending on the local operating system.
In this recipe, we will learn how to run Terraform in a Docker container, which will allow us to enjoy the following benefits:
- There is no need to install Terraform locally.
- We can have a Terraform runtime environment independent of the local operating system.
- We can test our Terraform configuration with different versions of Terraform.
Let's get started!
Getting ready
To complete this recipe, you'll need to know about Docker and its commands, as well as how to write Dockerfiles. Please read the documentation for more information: https://docs.docker.com/get-started/overview/
On our local computer, we installed Docker using a tool called Docker Desktop for Windows.
For Docker installation guides for other operating systems, please read the Docker installation documentation...