From 654c61eb841663e3b0817658366db27d5f82a6c0 Mon Sep 17 00:00:00 2001 From: Oleh Paduchak Date: Tue, 14 May 2024 13:01:53 +0300 Subject: [PATCH] reduced image size by 20x --- Dockerfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index fbc4180..0078448 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.22-alpine +FROM golang:1.22-alpine as build COPY ./ /go/src/github.com/CenterForOpenScience/fakecas @@ -11,7 +11,10 @@ ENV GIT_TAG ${GIT_TAG} RUN cd /go/src/github.com/CenterForOpenScience/fakecas \ && go mod download \ - && VERSION=${GIT_TAG} go build -o fakecas \ - && mv /go/src/github.com/CenterForOpenScience/fakecas/fakecas /usr/local/bin/ + && VERSION=${GIT_TAG} go build -o fakecas + +FROM alpine:3.19 as runtime + +COPY --from=build /go/src/github.com/CenterForOpenScience/fakecas/fakecas /usr/local/bin/ CMD ["fakecas"]