forked from open-policy-agent/conftest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (27 loc) · 1.06 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
FROM golang:1.12-alpine as builder
RUN apk --no-cache add git
WORKDIR /
COPY . /
RUN go build .
FROM bats/bats:v1.1.0 as acceptance
COPY --from=builder /conftest /usr/local/bin
COPY acceptance.bats /acceptance.bats
COPY examples /examples
RUN ./acceptance.bats
FROM golang:1.12-alpine as examples
ENV TERRAFORM_VERSION=0.12.0-rc1 \
KUSTOMIZE_VERSION=2.0.3
COPY --from=builder /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
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
WORKDIR /examples
FROM scratch
COPY --from=builder /conftest /
ENTRYPOINT ["/conftest"]
CMD ["--help"]