Skip to content

Commit

Permalink
reduced image size by 20x
Browse files Browse the repository at this point in the history
  • Loading branch information
opaduchak committed May 14, 2024
1 parent 9421e43 commit 654c61e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22-alpine
FROM golang:1.22-alpine as build


COPY ./ /go/src/github.com/CenterForOpenScience/fakecas
Expand All @@ -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"]

0 comments on commit 654c61e

Please sign in to comment.