A minimal Docker image for running Terraform and related tools, designed for use in CI/CD pipelines. This image is based on Alpine Linux and includes Terraform, curl, unzip, bash, git, and jq.
- Lightweight: Based on Alpine for a small footprint
- Multi-platform: Built for multiple architectures using Docker Buildx
- Automated CI: GitHub Actions workflow for automated builds and Docker Hub publishing
- Customizable: Easily override the Terraform version via build arguments
- Base:
alpine:3.21 - Terraform: Version specified by
TERRAFORM_VERSION(default: 1.11.4, can be overridden) - Utilities: curl, unzip, bash, git, jq
docker pull albertsj1/terraform:<tag>
docker run --rm -it albertsj1/terraform:latest --version
docker run --rm -v $(pwd):/workspace -w /workspace albertsj1/terraform:latest init
To build locally:
docker build --build-arg TERRAFORM_VERSION=1.11.4 -t terraform:local .
This repository includes a GitHub Actions workflow to:
- Fetch the latest Terraform version
- Build and push a multi-platform Docker image
- Publish to Docker Hub
DOCKERHUB_USERNAME: Docker Hub username (GitHub Actions variable)DOCKERHUB_TOKEN: Docker Hub token (GitHub Actions secret)
This project is licensed under the MIT License. See LICENSE for details.
John Alberts