From da08ea93f77c43fe1cec80e371c26852a7e531d5 Mon Sep 17 00:00:00 2001 From: Piotr Boruc Date: Mon, 9 Dec 2024 20:33:46 +0100 Subject: [PATCH] moved to scratch --- Dockerfile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2844d9f..8f431d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,17 @@ -FROM quay.io/wasilak/golang:1.23-alpine as builder +FROM quay.io/wasilak/golang:1.23 AS builder COPY . /app WORKDIR /app/ RUN mkdir -p ./dist -RUN go build -o ./dist/elastauth -FROM quay.io/wasilak/alpine:3 +RUN CGO_ENABLED=0 go build -o /elastauth -COPY --from=builder /app/dist/elastauth /elastauth +FROM scratch + +LABEL org.opencontainers.image.source="https://github.com/wasilak/elastauth" + +COPY --from=builder /elastauth . + +ENV USER=root CMD ["/elastauth"]