From 60a44820a9c827507aaf9a2098e4918ba64ccef9 Mon Sep 17 00:00:00 2001 From: KAMEGAWA Kazushi Date: Wed, 6 Mar 2024 20:31:50 +0900 Subject: [PATCH] fix: Add Terraform installation for ARM64 platform --- linux/base.Dockerfile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/linux/base.Dockerfile b/linux/base.Dockerfile index 050448be..9d3f1b88 100644 --- a/linux/base.Dockerfile +++ b/linux/base.Dockerfile @@ -140,7 +140,7 @@ RUN bash ./tdnfinstall.sh \ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then bash ./tdnfinstall.sh msodbcsql18 mssql-tools18; fi # Install Terraform - +RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then 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" \ @@ -148,8 +148,17 @@ RUN TF_VERSION=$(curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform && unzip terraform.zip \ && mv terraform /usr/local/bin/terraform \ && rm -f terraform.zip terraform.sha256 \ - && unset TF_VERSION + && unset TF_VERSION;fi +RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then +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_arm64.zip" \ + && wget -nv -O terraform.sha256 "https://releases.hashicorp.com/terraform/${TF_VERSION}/terraform_${TF_VERSION}_SHA256SUMS" \ + && echo "$(grep "${TF_VERSION}_linux_arm64.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;fi # Install azure-functions-core-tools RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then 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` \