Skip to content

Commit

Permalink
Dockerfile: Lint and prepare for multiarch
Browse files Browse the repository at this point in the history
Signed-off-by: Manuel Rüger <[email protected]>
  • Loading branch information
mrueg committed Jul 18, 2020
1 parent 8415206 commit c5a62be
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 .
Expand All @@ -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
Expand Down

0 comments on commit c5a62be

Please sign in to comment.