From b491c9f3997e9ce8fd860a42a4a3dc7b8b5feb8b Mon Sep 17 00:00:00 2001
From: Janne Koschinski <janne@kuschku.de>
Date: Thu, 24 May 2018 01:23:47 +0200
Subject: [PATCH] Implement minimal docker builds

---
 Dockerfile | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index f01d1e1..25d719a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,10 +1,13 @@
-FROM golang
-
+FROM golang as builder
 RUN curl https://glide.sh/get | sh
 
 WORKDIR /go/src/app
-COPY . .
+COPY glide.lock glide.yaml ./
 RUN glide install
-RUN go build -a app .
+COPY . .
+RUN CGO_ENABLED=0 GOOS=linux go build -a app .
 
-ENTRYPOINT ["./app"]
\ No newline at end of file
+FROM scratch
+COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
+COPY --from=builder /go/src/app/app /app
+ENTRYPOINT ["/app"]
\ No newline at end of file
-- 
GitLab