docker-terragrunt
Dockerized framework with Terraform, Terragrunt, Python, Make, Docker, Git, and all needed component
1M+
amd64 and arm64 images!Source code at devops-infra/docker-terragrunt.
Docker Hub images at docker.io/devopsinfra/docker-terragrunt
GitHub Packages images at ghcr.io/devops-infra/docker-terragrunt/docker-terragrunt
Alpine-based Docker image with Terraform or OpenTofu, together with Terragrunt, Go, Python, Make, Docker, Git, and all needed components to easily manage cloud infrastructure for CI/CD environments as a runner image.
Including cloud CLIs and SDKs for Amazon Web Services, Microsoft Azure, Google Cloud Platform.
Azure-enabled flavors are built on top of devops-infra/docker-azure-cli to reduce Azure CLI install time during image builds.
Best used as runner image for CI/CD in automation, as well as a consistent local run environment.
Please note focus of those images is to maintain availability of current versions of Terraform, OpenTofu and Terragrunt, not CLIs or other dependencies. Hence, images are updated when new version of Terraform, OpenTofu or Terragrunt is released. Furthermore, versioning labels of images contain versions of said software to emphasize it.
Dockerfile was based on two images made by cytopia: docker-terragrunt and docker-terragrunt-fmt . Original README files are included in this repository: docker-terragrunt and docker-terragrunt-fmt . This project grew much bigger than the original ones and is intended to be a framework for cloud Infrastructure-as-a-Code.
Tag of the image tells which version of Terraform and Terragrunt it contains and which public cloud provider CLI it's bundled with or not (see second table below).
| Current release full tag version value |
|---|
tf-1.15.8-ot-1.12.4-tg-1.1.0 |
| Registry | Example full image name | Image name | Image version | Terraform version | OpenTofu version | Terragrunt version |
|---|---|---|---|---|---|---|
| Docker Hub | devopsinfra/docker-terragrunt:tf-1.15.8-tg-1.1.0 | docker-terragrunt | tf-1.15.8-tg-1.1.0 | 1.15.8 | N/A | 1.1.0 |
| Docker Hub | devopsinfra/docker-terragrunt:ot-1.12.4-tg-1.1.0 | docker-terragrunt | ot-1.12.4-tg-1.1.0 | N/A | 1.12.4 | 1.1.0 |
| GitHub Packages | ghcr.io/devops-infra/docker-terragrunt/docker-terragrunt:tf-1.15.8-tg-1.1.0 | docker-terragrunt | tf-1.15.8-tg-1.1.0 | 1.15.8 | N/A | 1.1.0 |
| GitHub Packages | ghcr.io/devops-infra/docker-terragrunt/docker-terragrunt:ot-1.12.4-tg-1.1.0 | docker-terragrunt | ot-1.12.4-tg-1.1.0 | N/A | 1.12.4 | 1.1.0 |
Tag of the image tells also which cloud API/SDK is included in the image.
| Image name | AWS | Azure | GCP | OT | TF | Description |
|---|---|---|---|---|---|---|
docker-terragrunt:slim-tf-latest | ❌ | ❌ | ❌ | ❌ | ✅ | Lightweight version with TF, TG and bare dependencies. |
docker-terragrunt:slim-ot-latest | ❌ | ❌ | ❌ | ✅ | ❌ | Lightweight version with OT, TG and bare dependencies. |
docker-terragrunt:tf-latest | ❌ | ❌ | ❌ | ❌ | ✅ | Normal version, with TF. Having Go, Python, Make, etc. |
docker-terragrunt:ot-latest | ❌ | ❌ | ❌ | ✅ | ❌ | Normal version, with OT. Having Go, Python, Make, etc. |
docker-terragrunt:aws-tf-latest | ✅ | ❌ | ❌ | ❌ | ✅ | Normal version with AWS CLI, with TF. |
docker-terragrunt:aws-ot-latest | ✅ | ❌ | ❌ | ✅ | ❌ | Normal version with AWS CLI, with OT. |
docker-terragrunt:azure-tf-latest | ❌ | ✅ | ❌ | ❌ | ✅ | Normal version with Azure CLI, with TF. |
docker-terragrunt:azure-ot-latest | ❌ | ✅ | ❌ | ✅ | ❌ | Normal version with Azure CLI, with OT. |
docker-terragrunt:aws-azure-tf-latest | ✅ | ✅ | ❌ | ❌ | ✅ | Normal version with AWS and Azure CLIs, with TF. |
docker-terragrunt:aws-azure-ot-latest | ✅ | ✅ | ❌ | ✅ | ❌ | Normal version with AWS and Azure CLIs, with OT. |
docker-terragrunt:gcp-tf-latest | ❌ | ❌ | ✅ | ❌ | ✅ | Normal version with GCP CLI, with TF. |
docker-terragrunt:gcp-ot-latest | ❌ | ❌ | ✅ | ✅ | ❌ | Normal version with GCP CLI, with OT. |
docker-terragrunt:aws-gcp-tf-latest | ✅ | ❌ | ✅ | ❌ | ✅ | Normal version with AWS and GCP CLIs, with TF. |
docker-terragrunt:aws-gcp-ot-latest | ✅ | ❌ | ✅ | ✅ | ❌ | Normal version with AWS and GCP CLIs, with OT. |
docker-terragrunt:azure-gcp-tf-latest | ❌ | ✅ | ✅ | ❌ | ✅ | Normal version with Azure and GCP CLIs, with TF. |
docker-terragrunt:azure-gcp-ot-latest | ❌ | ✅ | ✅ | ✅ | ❌ | Normal version with Azure and GCP CLIs, with OT. |
docker-terragrunt:aws-azure-gcp-tf-latest | ✅ | ✅ | ✅ | ❌ | ✅ | Normal version with AWS, Azure and GCP CLIs, with TF. |
docker-terragrunt:aws-azure-gcp-ot-latest | ✅ | ✅ | ✅ | ✅ | ❌ | Normal version with AWS, Azure and GCP CLIs, with OT. |
Container-structure-tests validate both positive and negative cases for installed software.
For each flavor, tests run against both image variants (-tf-... and -ot-...).
| Flavor | Expected cloud CLIs present | Expected cloud CLIs absent | Extra constraints checked |
|---|---|---|---|
slim | none | aws, az, gcloud | curl, git, jq, vim, wget, unzip |
plain | none | aws, az, gcloud | slim flavor + task, make, docker, go, python3, tflint, hcledit, sops, etc. |
aws | aws | az, gcloud | plain flavor + boto3 |
azure | az | aws, gcloud | plain flavor |
gcp | gcloud | aws, az | plain flavor |
aws-azure | aws, az | gcloud | plain flavor |
aws-gcp | aws, gcloud | az | plain flavor |
azure-gcp | az, gcloud | aws | plain flavor |
aws-azure-gcp | aws, az, gcloud | none | plain flavor |
Additionally, tool-variant tests verify:
/data, e.g. --volume $(pwd):/data.--env AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN} or --volume ~/.aws/credentials:/root/.aws/credentials.--privileged --volume /var/run/docker.sock:/var/run/docker.sock..gitconfig and/or SSH key (if needed),
e.g. --volume ~/.gitconfig:/root/.gitconfig --volume ~/.ssh/id_rsa_github:/root/.ssh/id_rsa.gitconfig to mount[url "https://{GITHUB_TOKEN}@github.com/"]
insteadOf = https://github.com/
[url "https://{GITHUB_TOKEN}@github.com/"]
insteadOf = git+ssh://github.com/
[url "https://{GITHUB_TOKEN}@github.com/"]
insteadOf = [email protected]:
[url "https://github.com/"]
insteadOf = git+ssh://github.com/
[url "https://github.com/"]
insteadOf = [email protected]:
[url "ssh://[email protected]/"]
insteadOf = https://github.com/
[url "ssh://[email protected]/"]
insteadOf = [email protected]:
docker run --rm \
--user $(id -u):$(id -g) \
--volume $(pwd):/data \
devopsinfra/docker-terragrunt:latest format-hcl
docker run --rm \
--tty --interactive \
--env AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION} \
--env AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} \
--env AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} \
--env AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN} \
--user $(id -u):$(id -g) \
--volume $(pwd):/data \
devopsinfra/docker-terragrunt:aws-latest terraform plan
~/.gitconfig file with PAT.docker run --rm \
--tty --interactive \
--user $(id -u):$(id -g) \
--volume $(pwd):/data \
--volume ~/.gitconfig:/root/.gitconfig \
devopsinfra/docker-terragrunt:aws-latest terragrunt apply --terragrunt-working-dir some/module
docker run --rm \
--tty --interactive \
--user $(id -u):$(id -g) \
--volume $(pwd):/data \
devopsinfra/docker-terragrunt:latest make build
| Script name | Is included in PATH | Purpose | Source/Documentation |
|---|---|---|---|
format-hcl | Yes | For formatting all HCL files (.hcl, .tf and .tfvars) into format suggested by Hashicorp. | devops-infra |
terragrunt-fmt.sh | No | Dependency for format-hcl | cytopia |
entrypoint.sh | Yes | Main CMD target for Docker image, just to show main installed binaries versions. | devops-infra |
| Name | Type | Flavor | Description | Source/Documentation |
|---|---|---|---|---|
| awscli | Binary | aws | Interact with AWS via terminal. | https://github.com/aws/aws-cli |
| azure-cli | Binary | azure | Interact with Azure via terminal. | https://github.com/Azure/azure-cli |
| bc | Binary | non-slim | Numeric operations. | https://www.gnu.org/software/bc/bc.html |
| boto3 | Python library | aws | Interact with AWS via Python. | https://github.com/boto/boto3 |
| cloudflare | Python library | non-slim | Cloudflare API operations. | https://github.com/cloudflare/python-cloudflare |
| curl | Binary | slim | HTTP and API calls. | https://curl.haxx.se/ |
| docker | Binary | non-slim | Run nested Docker workloads (for example, Lambda packaging workflows). | https://github.com/docker/docker-ce |
| git | Binary | slim | Interact with Git repositories. | https://git-scm.com/ |
| go | Binary | non-slim | Build/install additional Go tooling. | https://go.dev/ |
| google-cloud-cli | Binary | gcp | Interact with GCP via terminal. | https://cloud.google.com/sdk |
| gnupg | Binary | non-slim | GPG operations (including AWS CLI signature verification). | https://gnupg.org/ |
| graphviz | Binary | non-slim | Generate graph output, for example from terraform graph. | https://graphviz.org/ |
| hcledit | Binary | non-slim | Read/write HCL files. | https://github.com/minamijoyo/hcledit |
| gh | Binary | non-slim | Interact with GitHub via official GitHub CLI. | https://cli.github.com/ |
| jq | Binary | slim | Parse JSON outputs. | https://stedolan.github.io/jq/ |
| make | Binary | non-slim | Makefile-based task orchestration. | https://www.gnu.org/software/make/ |
ncurses (tput) | Binary | non-slim | Color and terminal helpers used by automation scripts. | https://invisible-island.net/ncurses/announce.html |
openssh-client (ssh) | Binary | non-slim | Outbound SSH connections. | https://www.openssh.com/ |
| openssl | Binary | non-slim | Cryptographic operations and hashing. | https://github.com/openssl/openssl |
| opentofu | Binary | slim | Open-source Terraform alternative for IaC. | https://github.com/opentofu/opentofu |
| PyGithub | Python library | non-slim | Interact with GitHub API in Python. | https://github.com/PyGithub/PyGithub |
| python-hcl2 | Python library | non-slim | Parse HCL in Python. | https://github.com/amplify-education/python-hcl2 |
| python3 | Binary | non-slim | Execute Python scripts in automation workflows. | https://www.python.org/ |
python (python) | Binary | non-slim | python command alias to Python 3. | https://www.python.org/ |
python3-pip (pip3, pip) | Binary | non-slim | Python package management. | https://pip.pypa.io/ |
| requests | Python library | non-slim | HTTP requests from Python. | https://github.com/psf/requests |
| slack_sdk | Python library | non-slim | Slack integration in Python. | https://github.com/slackapi/python-slack-sdk |
| sops | Binary | non-slim | Encrypt/decrypt secrets used by Terragrunt workflows. | https://github.com/getsops/sops |
| task | Binary | non-slim | Taskfile-based task orchestration | https://taskfile.dev/ |
| terraform | Binary | slim | IaC engine used directly and by Terragrunt. | https://github.com/hashicorp/terraform |
| terragrunt | Binary | slim | IaC wrapper over Terraform/OpenTofu. | https://github.com/gruntwork-io/terragrunt |
| tflint | Binary | non-slim | Terraform/OpenTofu linting. | https://github.com/terraform-linters/tflint |
| unzip | Binary | slim | Extract archives during workflows. | http://infozip.sourceforge.net/ |
| vim | Binary | slim | Basic editor in container shell sessions. | https://www.vim.org/ |
| wget | Binary | slim | Download helper utility. | https://www.gnu.org/software/wget/ |
| zip | Binary | non-slim |
Content type
Image
Digest
sha256:ab39015b2…
Size
655.4 MB
Last updated
1 day ago
docker pull devopsinfra/docker-terragrunt:aws-azure-gcp-ot-latestPulls:
16,334
Last week