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"]