This Docker image includes Terraform and Terragrunt, which are essential tools for managing infrastructure as code. It can be used for local development to avoid managing different versions of these tools on your system or as part of your CI/CD pipelines. The lightweight, Ubuntu-based image ensures that you run your pipelines in a consistent environment.
Important
We intentionally do not pin the container image to a specific version in our examples to avoid the challenge of keeping the documentation aligned with the latest releases. However, we strongly recommend that you always specify the exact version of the container image in your code. Doing so ensures your infrastructure remains stable and predictable. Additionally, make sure to update versions systematically to avoid unexpected issues.
Tip
Three variants of the image are available on Docker Hub:
- The base image: Also tagged as
latest, this image contains only the essential tools required for Terragrunt and Terraform. - The
dev-toolsimage: Includes additional tools such asvim,tree,make, andgraphviz, which are useful during local development and when building Infrastructure-as-Code (IaC) projects. - The
azdoimage: Includes Node.js, a requirement for running Azure DevOps Pipeline container jobs with Linux containers on Windows hosts. For more details, refer to the official Azure documentation.
Choose the variant that best suits your specific task.
Pull the Docker image from the Docker Hub:
docker pull jbonnier/terragrunt:latestTo run the terraform command:
docker run -it --rm jbonnier/terragrunt:latest terraform -versionTo run the terragrunt command:
docker run -it --rm jbonnier/terragrunt:latest terragrunt -versionBy using Docker, you can avoid managing multiple versions of Terraform and Terragrunt on your local system. All you need is Docker, and you can run any encapsulated version of Terraform and Terragrunt inside the Docker image.
The Docker image is also beneficial in CI/CD pipelines, where it creates a consistent environment across different pipeline stages. This consistency ensures that your infrastructure builds are reliable and repeatable.
To customize the Docker image:
- Clone the repository and navigate to the directory with
git clone https://github.com/jblab/docker-terragrunt.git cd docker-terragrunt - Make your changes
- Build the Docker image with:
docker build -t <your-image-name>:<tag> .
Please consult BREAKING_CHANGES.md for more information about version history and compatibility.
Contributions are welcome. Check for any open issues or create a new one to discuss your idea.
The project is licensed under the Apache 2.0 License - refer to the LICENSE file for details.
