From 2d839cd5accfe8e0dd000aab40e45b77be218d52 Mon Sep 17 00:00:00 2001 From: Maverick Date: Fri, 14 Sep 2018 21:06:19 +0200 Subject: [PATCH] make clair/Dockerfile use build stages (#423) --- clair/Dockerfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/clair/Dockerfile b/clair/Dockerfile index 2933210..3759a4d 100644 --- a/clair/Dockerfile +++ b/clair/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:latest +FROM alpine:latest as builder RUN apk --no-cache add \ bzr \ @@ -20,9 +20,8 @@ RUN buildDeps=' \ set -x \ && apk --no-cache add $buildDeps \ && go get github.com/coreos/clair/cmd/clair \ - && mv /go/bin/clair /usr/bin/clair \ - && apk del $buildDeps \ - && rm -rf /go \ && echo "Build complete." +FROM alpine:latest +COPY --from=builder /go/bin/clair /usr/bin/clair ENTRYPOINT [ "clair" ]