From 14218b13960d0f5f5c8c90ab289700dc463a005d Mon Sep 17 00:00:00 2001 From: Darren Tu Date: Tue, 2 Apr 2024 11:44:59 -0700 Subject: [PATCH] Update Terraform (#389) * Update base.Dockerfile * Update base.Dockerfile --- linux/base.Dockerfile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/linux/base.Dockerfile b/linux/base.Dockerfile index d7b3a7c0..ae15a138 100644 --- a/linux/base.Dockerfile +++ b/linux/base.Dockerfile @@ -135,8 +135,18 @@ RUN bash ./tdnfinstall.sh \ gh \ redis \ cpio \ - gettext \ - terraform + gettext + +# Get latest version of Terraform. +# Customers require the latest version of Terraform. +RUN TF_VERSION=$(curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r -M ".current_version") \ + && wget -nv -O terraform.zip "https://releases.hashicorp.com/terraform/${TF_VERSION}/terraform_${TF_VERSION}_linux_amd64.zip" \ + && wget -nv -O terraform.sha256 "https://releases.hashicorp.com/terraform/${TF_VERSION}/terraform_${TF_VERSION}_SHA256SUMS" \ + && echo "$(grep "${TF_VERSION}_linux_amd64.zip" terraform.sha256 | awk '{print $1}') terraform.zip" | sha256sum -c \ + && unzip terraform.zip \ + && mv terraform /usr/local/bin/terraform \ + && rm -f terraform.zip terraform.sha256 \ + && unset TF_VERSION # Install azure-functions-core-tools RUN wget -nv -O Azure.Functions.Cli.zip `curl -fSsL https://api.github.com/repos/Azure/azure-functions-core-tools/releases/latest | grep "url.*linux-x64" | grep -v "sha2" | cut -d '"' -f4` \