mirror of
https://github.com/aquasecurity/kube-bench.git
synced 2024-11-25 09:28:16 +00:00
Use a single-stage build for now since Docker Hub doesn't support multi-stage builds. Also updated base image to current version of Go, 1.8
This commit is contained in:
parent
9dd393da99
commit
ed4ded7b3f
18
Dockerfile
18
Dockerfile
@ -1,19 +1,13 @@
|
|||||||
FROM golang:1.4.1
|
FROM golang:1.8
|
||||||
RUN mkdir /kube-bench
|
|
||||||
WORKDIR /kube-bench
|
WORKDIR /kube-bench
|
||||||
|
RUN go get github.com/aquasecurity/kube-bench
|
||||||
|
RUN cp /go/bin/kube-bench /kube-bench/ && chmod +x /kube-bench/kube-bench
|
||||||
|
WORKDIR /kube-bench/cfg
|
||||||
RUN wget https://raw.githubusercontent.com/aquasecurity/kube-bench/master/cfg/config.yaml && \
|
RUN wget https://raw.githubusercontent.com/aquasecurity/kube-bench/master/cfg/config.yaml && \
|
||||||
wget https://raw.githubusercontent.com/aquasecurity/kube-bench/master/cfg/federated.yaml && \
|
wget https://raw.githubusercontent.com/aquasecurity/kube-bench/master/cfg/federated.yaml && \
|
||||||
wget https://raw.githubusercontent.com/aquasecurity/kube-bench/master/cfg/master.yaml && \
|
wget https://raw.githubusercontent.com/aquasecurity/kube-bench/master/cfg/master.yaml && \
|
||||||
wget https://raw.githubusercontent.com/aquasecurity/kube-bench/master/cfg/node.yaml
|
wget https://raw.githubusercontent.com/aquasecurity/kube-bench/master/cfg/node.yaml
|
||||||
RUN go get github.com/aquasecurity/kube-bench
|
# When Docker Hub supports it, we would split this into a multi-stage build with the second part based on, say, alpine for size
|
||||||
RUN cp /go/bin/kube-bench /kube-bench/ && chmod +x /kube-bench/kube-bench
|
WORKDIR /
|
||||||
|
|
||||||
FROM alpine:latest
|
|
||||||
RUN mkdir -p /kube-bench/cfg
|
|
||||||
COPY --from=0 /kube-bench/kube-bench /kube-bench/kube-bench
|
|
||||||
COPY --from=0 /kube-bench/config.yaml /kube-bench/cfg/config.yaml
|
|
||||||
COPY --from=0 /kube-bench/federated.yaml /kube-bench/cfg/federated.yaml
|
|
||||||
COPY --from=0 /kube-bench/master.yaml /kube-bench/cfg/master.yaml
|
|
||||||
COPY --from=0 /kube-bench/node.yaml /kube-bench/cfg/node.yaml
|
|
||||||
ADD entrypoint.sh /entrypoint.sh
|
ADD entrypoint.sh /entrypoint.sh
|
||||||
ENTRYPOINT /entrypoint.sh
|
ENTRYPOINT /entrypoint.sh
|
||||||
|
Loading…
Reference in New Issue
Block a user