From 327cd34f48e26b1bc479b5d5acd6d7aa854f6452 Mon Sep 17 00:00:00 2001 From: Wes McNamee Date: Fri, 9 Feb 2018 10:37:00 -0800 Subject: [PATCH] Makes an automated docker build possible * Updates the Dockerfile to use a multi-stage build * Allows the image to be built without requiring Go to be installed or requiring any prerequisite steps Resolves #60 --- Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index df68cd45..c84582ce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,14 @@ +FROM golang as builder +WORKDIR /go/src/github.com/upmc-enterprises/registry-creds +COPY . . +RUN make build + FROM alpine:3.4 MAINTAINER Steve Sloka RUN apk add --update ca-certificates && \ rm -rf /var/cache/apk/* -COPY registry-creds registry-creds +COPY --from=builder /go/src/github.com/upmc-enterprises/registry-creds/registry-creds registry-creds ENTRYPOINT ["/registry-creds"]