[PR #178] [MERGED] feat(tfenv): allow installing a custom Terraform version using tfenv #188

Closed
opened 2026-05-06 12:38:06 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/patrickchugh/terravision/pull/178
Author: @FalcoSuessgott
Created: 3/23/2026
Status: Merged
Merged: 3/29/2026
Merged by: @patrickchugh

Base: mainHead: tenv


📝 Commits (1)

  • 1e30de2 feat(tfenv): include tfenv to specifiy TF version

📊 Changes

3 files changed (+32 additions, -7 deletions)

View changed files

📝 Dockerfile (+11 -7)
📝 README.md (+10 -0)
docker-entrypoint.sh (+11 -0)

📄 Description

Currently terravision hardodes the TF version in its Dockerfile. This makes it difficult to use terravision with TF setups that differ from the upstream image versions.

This PR adds tfenv to the Dockerfile and invokes tfenv only when TFENV_TERRAFORM_VERSION has been specified, which then downloads and installs the specified TF version before invoking terravision:

Example: specifying no custom Terraform version:

> docker run -e TFENV_TERRAFORM_VERSION=1.13.0 test draw --source .
Installing Terraform v1.13.0
Downloading release tarball from https://releases.hashicorp.com/terraform/1.13.0/terraform_1.13.0_linux_amd64.zip
######################################################################## 100.0%
Downloading SHA hash file from https://releases.hashicorp.com/terraform/1.13.0/terraform_1.13.0_SHA256SUMS
Not instructed to use Local PGP (/home/terravision/.tfenv/use-{gpgv,gnupg}) & No keybase install found, skipping OpenPGP signature verification
terraform_1.13.0_linux_amd64.zip: OK
Archive:  /tmp/tfenv_download.JIDCBm/terraform_1.13.0_linux_amd64.zip
  inflating: /home/terravision/.tfenv/versions/1.13.0/LICENSE.txt  
  inflating: /home/terravision/.tfenv/versions/1.13.0/terraform  
Installation of terraform v1.13.0 successful. To make this your default version, run 'tfenv use 1.13.0'
Switching default version to v1.13.0
Default version (when not overridden by .terraform-version or TFENV_TERRAFORM_VERSION) is now: 1.13.0


 _____                          _     _             
/__   \___ _ __ _ __ __ ___   _(_)___(_) ___  _ __  
  / /\/ _ \ '__| '__/ _` \ \ / / / __| |/ _ \| '_ \ 
 / / |  __/ |  | | | (_| |\ V /| \__ \ | (_) | | | |
 \/   \___|_|  |_|  \__,_| \_/ |_|___/_|\___/|_| |_|



Preflight check..
  dot command detected: /usr/bin/dot
  gvpr command detected: /usr/bin/gvpr
  git command detected: /usr/bin/git
  terraform command detected: /home/terravision/.tfenv/bin/terraform
  terraform version detected: Terraform v1.13.0
...

Example: specifying a custom Terraform version:

> docker run test draw --source .
docker run test draw --source .
Alias tip: d run test draw --source .


 _____                          _     _             
/__   \___ _ __ _ __ __ ___   _(_)___(_) ___  _ __  
  / /\/ _ \ '__| '__/ _` \ \ / / / __| |/ _ \| '_ \ 
 / / |  __/ |  | | | (_| |\ V /| \__ \ | (_) | | | |
 \/   \___|_|  |_|  \__,_| \_/ |_|___/_|\___/|_| |_|



Preflight check..
  dot command detected: /usr/bin/dot
  gvpr command detected: /usr/bin/gvpr
  git command detected: /usr/bin/git
  terraform command detected: /usr/local/bin/terraform
  terraform version detected: Terraform v1.10.5
...

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/patrickchugh/terravision/pull/178 **Author:** [@FalcoSuessgott](https://github.com/FalcoSuessgott) **Created:** 3/23/2026 **Status:** ✅ Merged **Merged:** 3/29/2026 **Merged by:** [@patrickchugh](https://github.com/patrickchugh) **Base:** `main` ← **Head:** `tenv` --- ### 📝 Commits (1) - [`1e30de2`](https://github.com/patrickchugh/terravision/commit/1e30de212cc328c15408fecc64ab37b2fa018bf3) feat(tfenv): include tfenv to specifiy TF version ### 📊 Changes **3 files changed** (+32 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `Dockerfile` (+11 -7) 📝 `README.md` (+10 -0) ➕ `docker-entrypoint.sh` (+11 -0) </details> ### 📄 Description Currently `terravision` hardodes the TF version in its Dockerfile. This makes it difficult to use `terravision` with TF setups that differ from the upstream image versions. This PR adds [tfenv](https://github.com/tfutils/tfenv) to the Dockerfile and invokes `tfenv` **only when** `TFENV_TERRAFORM_VERSION` has been specified, which then downloads and installs the specified TF version before invoking `terravision`: Example: specifying no custom Terraform version: ```bash > docker run -e TFENV_TERRAFORM_VERSION=1.13.0 test draw --source . Installing Terraform v1.13.0 Downloading release tarball from https://releases.hashicorp.com/terraform/1.13.0/terraform_1.13.0_linux_amd64.zip ######################################################################## 100.0% Downloading SHA hash file from https://releases.hashicorp.com/terraform/1.13.0/terraform_1.13.0_SHA256SUMS Not instructed to use Local PGP (/home/terravision/.tfenv/use-{gpgv,gnupg}) & No keybase install found, skipping OpenPGP signature verification terraform_1.13.0_linux_amd64.zip: OK Archive: /tmp/tfenv_download.JIDCBm/terraform_1.13.0_linux_amd64.zip inflating: /home/terravision/.tfenv/versions/1.13.0/LICENSE.txt inflating: /home/terravision/.tfenv/versions/1.13.0/terraform Installation of terraform v1.13.0 successful. To make this your default version, run 'tfenv use 1.13.0' Switching default version to v1.13.0 Default version (when not overridden by .terraform-version or TFENV_TERRAFORM_VERSION) is now: 1.13.0 _____ _ _ /__ \___ _ __ _ __ __ ___ _(_)___(_) ___ _ __ / /\/ _ \ '__| '__/ _` \ \ / / / __| |/ _ \| '_ \ / / | __/ | | | | (_| |\ V /| \__ \ | (_) | | | | \/ \___|_| |_| \__,_| \_/ |_|___/_|\___/|_| |_| Preflight check.. dot command detected: /usr/bin/dot gvpr command detected: /usr/bin/gvpr git command detected: /usr/bin/git terraform command detected: /home/terravision/.tfenv/bin/terraform terraform version detected: Terraform v1.13.0 ... ``` Example: specifying a custom Terraform version: ```bash > docker run test draw --source . docker run test draw --source . Alias tip: d run test draw --source . _____ _ _ /__ \___ _ __ _ __ __ ___ _(_)___(_) ___ _ __ / /\/ _ \ '__| '__/ _` \ \ / / / __| |/ _ \| '_ \ / / | __/ | | | | (_| |\ V /| \__ \ | (_) | | | | \/ \___|_| |_| \__,_| \_/ |_|___/_|\___/|_| |_| Preflight check.. dot command detected: /usr/bin/dot gvpr command detected: /usr/bin/gvpr git command detected: /usr/bin/git terraform command detected: /usr/local/bin/terraform terraform version detected: Terraform v1.10.5 ... ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 12:38:06 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/terravision#188
No description provided.