mirror of
https://github.com/aquasecurity/kube-bench.git
synced 2024-11-21 23:58:06 +00:00
Allow kube-bench to be run inside its distribution container
This commit is contained in:
parent
67786fd3ef
commit
3560bbbbfa
26
Dockerfile
26
Dockerfile
@ -1,13 +1,21 @@
|
|||||||
FROM golang:1.9
|
FROM golang:1.9 AS build
|
||||||
WORKDIR /kube-bench
|
WORKDIR /go/src/github.com/aquasecurity/kube-bench/
|
||||||
RUN go get github.com/aquasecurity/kube-bench
|
ADD glide.lock glide.yaml ./
|
||||||
|
RUN go get github.com/Masterminds/glide && glide install
|
||||||
|
ADD main.go .
|
||||||
|
ADD check/ check/
|
||||||
|
ADD cmd/ cmd/
|
||||||
|
RUN CGO_ENABLED=0 go install -a -ldflags '-w'
|
||||||
|
|
||||||
FROM alpine:latest
|
FROM alpine:latest AS run
|
||||||
WORKDIR /
|
WORKDIR /opt/kube-bench/
|
||||||
COPY --from=0 /go/bin/kube-bench /kube-bench
|
# add GNU ps for -C, -o cmd, and --no-headers support
|
||||||
COPY --from=0 /go/src/github.com/aquasecurity/kube-bench/cfg /cfg
|
# https://github.com/aquasecurity/kube-bench/issues/109
|
||||||
COPY --from=0 /go/src/github.com/aquasecurity/kube-bench/entrypoint.sh /entrypoint.sh
|
RUN apk --no-cache add procps
|
||||||
ENTRYPOINT /entrypoint.sh
|
COPY --from=build /go/bin/kube-bench /usr/local/bin/kube-bench
|
||||||
|
ADD entrypoint.sh .
|
||||||
|
ADD cfg/ cfg/
|
||||||
|
ENTRYPOINT ["./entrypoint.sh"]
|
||||||
|
|
||||||
# Build-time metadata as defined at http://label-schema.org
|
# Build-time metadata as defined at http://label-schema.org
|
||||||
ARG BUILD_DATE
|
ARG BUILD_DATE
|
||||||
|
0
hooks/build
Normal file → Executable file
0
hooks/build
Normal file → Executable file
Loading…
Reference in New Issue
Block a user