From 501844124575cf8ad4977483df3160aa8b0f988d Mon Sep 17 00:00:00 2001 From: awbn <603836+awbn@users.noreply.github.com> Date: Wed, 30 Oct 2024 03:27:10 -0700 Subject: [PATCH] Move production Docker image to Alpine (#280) --- Dockerfile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index c7f4d2b..fb2977e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,15 +14,14 @@ COPY . . RUN go get -d -v ./... RUN CGO_ENABLED=0 go build -a -installsuffix cgo -o gickup . -# Use scratch as production environment -> Small builds -FROM scratch as production +# Use alpine as production environment -> Small builds +FROM alpine:3.20 as production +RUN apk add -U --no-cache ca-certificates tzdata git git-lfs +RUN git lfs install + WORKDIR / -# Copy valid SSL certs from the builder for fetching github/gitlab/... -COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ -# Copy zoneinfo for getting the right cron timezone -COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo # Copy the main executable from the builder COPY --from=builder /go/src/github.com/cooperspencer/gickup/gickup /gickup/gickup ENTRYPOINT [ "/gickup/gickup" ] -CMD [ "/gickup/conf.yml" ] +CMD [ "/gickup/conf.yml" ] \ No newline at end of file