Handle invalid values for TARGETPLATFORM. (#2223)

Report an error during `docker build` if `TARGETPLATFORM` has an unexpected
value.
This commit is contained in:
Emil 'Skeen' Madsen
2022-05-13 23:15:51 +02:00
committed by GitHub
parent eb8f838523
commit d23f7d438e

View File

@@ -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 && \