Docker Terraform Image
342
You can find this image in the link below.
https://hub.docker.com/r/raffaeldutra/docker-terraform
All tags available for this image, which is based on Terraform versions. https://cloud.docker.com/repository/docker/raffaeldutra/docker-terraform/tags
Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in-house solutions. Configuration files describe to Terraform the components needed to run a single application or your entire datacenter.
You will find the whole documentation here: https://https://www.terraform.io/docs/index.html
You will just follow the default "behavior" for Terraform, run the init, plan, apply and destroy commands in your CLI as usual, but inside a container.
You need to provide a folder containing your infrastructure's definition.
$(pwd).~/.aws or using another approach.docker build -t raffaeldutra/docker-terraform .
The terraform init command.
On this example:
/terraform volume.AWS.docker run --rm \
-v $(pwd):/terraform \
-v $(pwd)/modules:/terraform/modules \
-v ${HOME}/.aws:/root/.aws \
raffaeldutra/docker-terraform:v0.12.0 \
terraform init
The terraform plan command.
docker run --rm \
-v $(pwd):/terraform \
-v $(pwd)/modules:/terraform/modules \
-v ${HOME}/.aws:/root/.aws \
raffaeldutra/docker-terraform:v0.12.0 \
terraform plan
The terraform apply command.
Here we need to map ssh directory, because on this example, it generates keys in /tmp/ssh
docker run --rm \
-v $(pwd):/terraform \
-v $(pwd)/modules:/terraform/modules \
-v ${HOME}/.aws:/root/.aws \
-v $(pwd)/ssh:/tmp/ssh \
raffaeldutra/docker-terraform:v0.12.0 \
terraform apply -auto-approve
The terraform destroy command.
docker run --rm \
-v $(pwd):/terraform \
-v $(pwd)/modules:/terraform/modules \
-v ${HOME}/.aws:/root/.aws \
raffaeldutra/docker-terraform:v0.12.0 \
terraform destroy -auto-approve
Content type
Image
Digest
Size
39.9 MB
Last updated
over 7 years ago
docker pull raffaeldutra/docker-terraform