This repository provides a minimal Terraform Docker image that can be used by your deployment scripts. It is based on Alpine 3.10.
UPDATE: After reading this article I no longer recommend using this image unless you know what you're doing.
This image is designed to be run in a controlled CI/CD environment and not in your production systems. It DOES NOT change the user! The container will run as root
and in order to take advantage of docker-in-docker
you must bind-mount the Docker socket onto this container.
This is not a recommended practice and if you choose to use it, you should at least guarantee to have limited network access to your environment and run the Docker daemon with userns-remap.
The image comes with the following utilities:
- Terramform v0.12.12
- Docker CLI v19.03.4
- AWS CLI v1.16.266 (running as D-in-D)
In order for you to run other docker from within a Terraform "local-exec" provisioner, this image must be run with a volume mount for binding the Docker daemon socket into the container:
$ docker run --rm -t --init \
-v "/var/run/docker.sock:/var/run/docker.sock" \
-v "$(pwd):$(pwd)" -w "$(pwd)" \
roiavidan/terraform-dind:latest \
...