Public repository for ragedunicorn docker terraform images
3.2K

A lightweight Terraform CLI build on Alpine Linux. The official Terraform release
is GPG- and checksum-verified at build time, then shipped as a non-root,
single-purpose image with terraform as its entrypoint.
# Pull latest version
docker pull ragedunicorn/terraform:latest
# Or pull a specific version (see the Tags tab for the available versions)
docker pull ragedunicorn/terraform:<terraform-version>-alpine<alpine-version>-<build>
# Show the version
docker run --rm ragedunicorn/terraform:latest version
# Run against a configuration in the current directory
docker run --rm -v "$(pwd)":/workspace ragedunicorn/terraform:latest init
On Windows, use the PowerShell form - ${PWD} with braces and the colon
inside the quotes (without braces PowerShell parses $PWD: as a
scope-qualified variable, as in $env:PATH, and rejects the argument):
# Run against a configuration in the current directory
docker run --rm -v "${PWD}:/workspace" ragedunicorn/terraform:latest init
terraform is the entrypoint, nothing else bundledterraform userlinux/amd64 and linux/arm64docker run --rm -v "$(pwd)":/workspace ragedunicorn/terraform:latest init
docker run --rm -v "$(pwd)":/workspace ragedunicorn/terraform:latest plan
docker run --rm -v "$(pwd)":/workspace ragedunicorn/terraform:latest apply
PowerShell:
docker run --rm -v "${PWD}:/workspace" ragedunicorn/terraform:latest init
docker run --rm -v "${PWD}:/workspace" ragedunicorn/terraform:latest plan
docker run --rm -v "${PWD}:/workspace" ragedunicorn/terraform:latest apply
docker run --rm --user "$(id -u):$(id -g)" \
-v "$(pwd)":/workspace ragedunicorn/terraform:latest init
On Windows hosts this is not needed: Docker Desktop bind mounts do not carry
Unix file ownership, so --user matching has no effect (and id does not
exist in PowerShell).
docker run --rm \
-v "$(pwd)":/workspace \
-v terraform-plugin-cache:/home/terraform/.terraform.d/plugin-cache \
-e TF_PLUGIN_CACHE_DIR=/home/terraform/.terraform.d/plugin-cache \
ragedunicorn/terraform:latest init
PowerShell:
docker run --rm `
-v "${PWD}:/workspace" `
-v terraform-plugin-cache:/home/terraform/.terraform.d/plugin-cache `
-e TF_PLUGIN_CACHE_DIR=/home/terraform/.terraform.d/plugin-cache `
ragedunicorn/terraform:latest init
docker run --rm \
-e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_REGION \
-v "$(pwd)":/workspace ragedunicorn/terraform:latest apply
PowerShell:
docker run --rm `
-e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_REGION `
-v "${PWD}:/workspace" ragedunicorn/terraform:latest apply
terraform.tfstate,
.terraform.lock.hcl and .terraform/. Do not mount /workspace read-only.terraform user;
match your host user with --user "$(id -u):$(id -g)" so files stay yours.init â plan â apply).This image uses versioning that includes all component versions:
Format: {terraform_version}-alpine{alpine_version}-{build_number}
X.Y.Z is the Terraform version, A.B.C the Alpine version:
X.Y.Z-alpineA.B.C-1 - Terraform X.Y.Z on Alpine A.B.C, first buildX.Y.Z-alpineA.B.C-2 - Rebuild of the same versions (base CVE patch, fixes)X.Y.Z-alpineA.B.D-1 - Alpine Linux patch updateX.Y+1.0-alpineA.B.C-1 - Terraform version update (build resets to 1)X.Y.Z - Most recent build of Terraform X.Y.Zlatest - Most recent stable releaseThe available versions are listed in the Tags tabâ .
This image's build tooling is MIT-licensed. The bundled Terraform binary is distributed by HashiCorp under the Business Source License 1.1 (BSL-1.1) - source-available, not OSI open source. See the HashiCorp LICENSEâ . For a fully open source alternative, see OpenTofuâ (MPL-2.0).
Content type
Image
Digest
sha256:5eb88304bâĶ
Size
47.6 MB
Last updated
19 days ago
docker pull ragedunicorn/terraform