From d23f7d438ec91cadfc8554a17daaae8bd3e277b0 Mon Sep 17 00:00:00 2001 From: Emil 'Skeen' Madsen Date: Fri, 13 May 2022 23:15:51 +0200 Subject: [PATCH] Handle invalid values for `TARGETPLATFORM`. (#2223) Report an error during `docker build` if `TARGETPLATFORM` has an unexpected value. --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index abf518997..7ace5ea1b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,6 +21,7 @@ RUN AVAILABLE_TERRAFORM_VERSIONS="0.11.15 0.12.31 0.13.7 0.14.11 0.15.5 1.0.11 $ "linux/amd64") TERRAFORM_ARCH=amd64 ;; \ "linux/arm64") TERRAFORM_ARCH=arm64 ;; \ "linux/arm/v7") TERRAFORM_ARCH=arm ;; \ + *) echo "ERROR: 'TARGETPLATFORM' value expected: ${TARGETPLATFORM}"; exit 1 ;; \ esac && \ for VERSION in ${AVAILABLE_TERRAFORM_VERSIONS}; do \ curl -LOs https://releases.hashicorp.com/terraform/${VERSION}/terraform_${VERSION}_linux_${TERRAFORM_ARCH}.zip && \