From edc0904bd3ee9890c0994c55a6fc0e671dd245ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Meira?= Date: Wed, 10 Sep 2025 17:26:19 +0100 Subject: [PATCH] fix: Simplify Dockerfile and make it compatible with goreleaser --- Dockerfile | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index db40db5..f09bd94 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,11 @@ -FROM alpine:latest as alpine +FROM alpine:latest AS alpine -RUN apk add -U --no-cache ca-certificates +# We need git to automatically get the changes of a deployment +RUN apk add -U --no-cache ca-certificates git -# Build a statically linked git binary -ENV GIT_VERSION "v2.30.0" -WORKDIR /tmp/git -RUN apk add -U --no-cache git alpine-sdk autoconf automake zlib-dev zlib-static zlib -RUN \ - git clone --depth=1 git://github.com/git/git -b $GIT_VERSION /tmp/git && \ - make configure && \ - ./configure prefix=/tmp CFLAGS="${CFLAGS} -static" && \ - make install NO_TCLTK="YesPlease" +# See https://goreleaser.com/customization/dockers_v2/#how-it-works +ARG TARGETPLATFORM -FROM scratch WORKDIR /workdir -COPY pulse-event-cli /bin/ -COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ -COPY --from=alpine /tmp/bin/git /bin/git +COPY $TARGETPLATFORM/pulse-event-cli /bin/ ENTRYPOINT ["pulse-event-cli"]