From 877ef47dc9aa4911bcbf28f4a15a3d945248a402 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=96=9F=E9=85=8C=20=E9=B5=AC=E5=85=84?= <tgckpg@gmail.com>
Date: Wed, 14 Sep 2022 23:40:51 +0800
Subject: [PATCH] Smaller image

---
 Dockerfile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index c0f86ad..5403543 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM golang:1.19-alpine
+FROM golang:1.19-alpine AS build
 
 WORKDIR /app
 
@@ -12,4 +12,10 @@ COPY *.go ./
 
 RUN go build -o /golifehkbot
 
+FROM scratch
+
+COPY --chown=0:0 --from=build /golifehkbot /
+
+WORKDIR /tmp
+
 CMD [ "/golifehkbot" ]