Use COPY instead of ADD in Dockerfile (#502)

pull/524/head
gy741 5 years ago committed by Roberto Rojas
parent 9c6d4de860
commit 230d286708

@ -1,9 +1,9 @@
FROM golang:1.12 AS build FROM golang:1.12 AS build
WORKDIR /go/src/github.com/aquasecurity/kube-bench/ WORKDIR /go/src/github.com/aquasecurity/kube-bench/
ADD go.mod go.sum ./ COPY go.mod go.sum ./
ADD main.go . COPY main.go .
ADD check/ check/ COPY check/ check/
ADD cmd/ cmd/ COPY cmd/ cmd/
ARG KUBEBENCH_VERSION ARG KUBEBENCH_VERSION
RUN GO111MODULE=on CGO_ENABLED=0 go install -a -ldflags "-X github.com/aquasecurity/kube-bench/cmd.KubeBenchVersion=${KUBEBENCH_VERSION} -w" RUN GO111MODULE=on CGO_ENABLED=0 go install -a -ldflags "-X github.com/aquasecurity/kube-bench/cmd.KubeBenchVersion=${KUBEBENCH_VERSION} -w"
@ -13,8 +13,8 @@ WORKDIR /opt/kube-bench/
# https://github.com/aquasecurity/kube-bench/issues/109 # https://github.com/aquasecurity/kube-bench/issues/109
RUN apk --no-cache add procps RUN apk --no-cache add procps
COPY --from=build /go/bin/kube-bench /usr/local/bin/kube-bench COPY --from=build /go/bin/kube-bench /usr/local/bin/kube-bench
ADD entrypoint.sh . COPY entrypoint.sh .
ADD cfg/ cfg/ COPY cfg/ cfg/
ENTRYPOINT ["./entrypoint.sh"] ENTRYPOINT ["./entrypoint.sh"]
CMD ["install"] CMD ["install"]

Loading…
Cancel
Save