Skip to content

Commit 14218b1

Browse files
authored
Update Terraform (#389)
* Update base.Dockerfile * Update base.Dockerfile
1 parent f224dbe commit 14218b1

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

linux/base.Dockerfile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,18 @@ RUN bash ./tdnfinstall.sh \
135135
gh \
136136
redis \
137137
cpio \
138-
gettext \
139-
terraform
138+
gettext
139+
140+
# Get latest version of Terraform.
141+
# Customers require the latest version of Terraform.
142+
RUN TF_VERSION=$(curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r -M ".current_version") \
143+
&& wget -nv -O terraform.zip "https://releases.hashicorp.com/terraform/${TF_VERSION}/terraform_${TF_VERSION}_linux_amd64.zip" \
144+
&& wget -nv -O terraform.sha256 "https://releases.hashicorp.com/terraform/${TF_VERSION}/terraform_${TF_VERSION}_SHA256SUMS" \
145+
&& echo "$(grep "${TF_VERSION}_linux_amd64.zip" terraform.sha256 | awk '{print $1}') terraform.zip" | sha256sum -c \
146+
&& unzip terraform.zip \
147+
&& mv terraform /usr/local/bin/terraform \
148+
&& rm -f terraform.zip terraform.sha256 \
149+
&& unset TF_VERSION
140150

141151
# Install azure-functions-core-tools
142152
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` \

0 commit comments

Comments
 (0)