From eed1e0a283ddfb663a0af3df9b59e1286b2d3cfc Mon Sep 17 00:00:00 2001 From: lowikian <38097264+bugmaschine@users.noreply.github.com> Date: Tue, 27 May 2025 08:47:09 +0200 Subject: [PATCH] slim down the docker image (#9) * trying to slim down the image * copy the bin from the right place --------- Co-authored-by: Lowikian --- Dockerfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 212c271..7f499a0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.24.3-bookworm AS base +FROM golang:1.24.3-bookworm AS build WORKDIR /build @@ -10,6 +10,9 @@ COPY src/. . RUN go build -o e6-cache -ldflags "-X main.debugMode=false" -EXPOSE 8080 +# copy to simpler image +FROM scratch +COPY --from=build /build/e6-cache /bin/e6-cache +CMD ["/bin/e6-cache"] -CMD ["/build/e6-cache"] +EXPOSE 8080