From 0424532587bb4b4acf7ed63039dd837deb78835f Mon Sep 17 00:00:00 2001 From: moogly81 Date: Fri, 6 Oct 2023 03:53:15 +0200 Subject: [PATCH] feat: set default tf & conftest env vars for apline (#3806) * Allow DEFAULT_CONFTEST_VERSION and DEFAULT_TERRAFORM_VERSION in alpine image * update go image to pass build test --------- Co-authored-by: Damien Sonney --- Dockerfile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 623ef4c0a9..e48c5f4261 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,9 @@ ARG ALPINE_TAG=3.18.4 ARG DEBIAN_TAG=12.1-slim +ARG DEFAULT_TERRAFORM_VERSION=1.5.7 +ARG DEFAULT_CONFTEST_VERSION=0.46.0 + # Stage 1: build artifact and download deps FROM golang:1.21.2-alpine AS builder @@ -14,6 +17,11 @@ ENV ATLANTIS_COMMIT=${ATLANTIS_COMMIT} ARG ATLANTIS_DATE=unknown ENV ATLANTIS_DATE=${ATLANTIS_DATE} +ARG DEFAULT_TERRAFORM_VERSION +ENV DEFAULT_TERRAFORM_VERSION=${DEFAULT_TERRAFORM_VERSION} +ARG DEFAULT_CONFTEST_VERSION +ENV DEFAULT_CONFTEST_VERSION=${DEFAULT_CONFTEST_VERSION} + WORKDIR /app # This is needed to download transitive dependencies instead of compiling them @@ -60,7 +68,8 @@ WORKDIR /tmp/build # install conftest # renovate: datasource=github-releases depName=open-policy-agent/conftest -ENV DEFAULT_CONFTEST_VERSION=0.46.0 +ARG DEFAULT_CONFTEST_VERSION +ENV DEFAULT_CONFTEST_VERSION=${DEFAULT_CONFTEST_VERSION} SHELL ["/bin/bash", "-o", "pipefail", "-c"] RUN AVAILABLE_CONFTEST_VERSIONS=${DEFAULT_CONFTEST_VERSION} && \ case ${TARGETPLATFORM} in \ @@ -121,7 +130,8 @@ RUN case ${TARGETPLATFORM} in \ # install terraform binaries # renovate: datasource=github-releases depName=hashicorp/terraform versioning=hashicorp -ENV DEFAULT_TERRAFORM_VERSION=1.5.7 +ARG DEFAULT_TERRAFORM_VERSION +ENV DEFAULT_TERRAFORM_VERSION=${DEFAULT_TERRAFORM_VERSION} # In the official Atlantis image, we only have the latest of each Terraform version. # Each binary is about 80 MB so we limit it to the 4 latest minor releases or fewer