diff --git a/Dockerfile b/Dockerfile index dec51ee7e4..15a82f294f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,9 @@ FROM golang:1.13-alpine as base -ENV GOOS=linux CGO_ENABLED=0 GOARCH=amd64 -RUN apk --no-cache add git +ARG ARCH=amd64 +ENV GOOS=linux \ + CGO_ENABLED=0 \ + GOARCH=${ARCH} +RUN apk add --no-cache git WORKDIR /app COPY go.mod . @@ -21,25 +24,25 @@ RUN go test -v ./... FROM base as acceptance COPY --from=builder /app/conftest /app/conftest -RUN apk add --update npm bash +RUN apk add --no-cache npm bash RUN npm install -g bats RUN bats acceptance.bats ## EXAMPLES STAGE ## FROM base as examples -ENV TERRAFORM_VERSION=0.12.0-rc1 \ +ENV TERRAFORM_VERSION=0.12.28 \ KUSTOMIZE_VERSION=2.0.3 COPY --from=builder /app/conftest /usr/local/bin COPY examples /examples -RUN apk add --update npm make git jq ca-certificates openssl unzip wget && \ - cd /tmp && \ - wget https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \ - unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip -d /usr/local/bin +WORKDIR /tmp +RUN apk add --no-cache npm make git jq ca-certificates openssl unzip wget && \ + wget "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip" && \ + unzip "terraform_${TERRAFORM_VERSION}_linux_amd64.zip" -d /usr/local/bin -RUN wget -O /usr/local/bin/kustomize https://github.com/kubernetes-sigs/kustomize/releases/download/v${KUSTOMIZE_VERSION}/kustomize_${KUSTOMIZE_VERSION}_linux_amd64 && \ +RUN wget -O /usr/local/bin/kustomize "https://github.com/kubernetes-sigs/kustomize/releases/download/v${KUSTOMIZE_VERSION}/kustomize_${KUSTOMIZE_VERSION}_linux_amd64" && \ chmod +x /usr/local/bin/kustomize RUN go get -u cuelang.org/go/cmd/cue