From 3931d81e781b64649251e955975eeed4b052598a Mon Sep 17 00:00:00 2001 From: Andrew Schleifer Date: Wed, 12 Sep 2018 14:58:53 +0800 Subject: [PATCH] define a WORKDIR makes cache invalidation less likely --- Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 531491a..c4ddcd2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,8 @@ FROM golang:alpine as builder RUN apk add git COPY main.go /go/src/github.com/discourse/discourse-auth-proxy/ -RUN cd /go/src/github.com/discourse/discourse-auth-proxy \ - && go get \ - && go build +WORKDIR /go/src/github.com/discourse/discourse-auth-proxy +RUN go get && go build FROM alpine:latest COPY --from=builder /go/bin/discourse-auth-proxy /bin/