The pre-commit Docker image has the Hashicorp repo which makes installing the latest version Terraform much easier.