Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 6 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
FROM alpine:latest as alpine
FROM alpine:latest AS alpine

Check warning on line 1 in Dockerfile

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

Dockerfile#L1

Using latest is prone to errors if the image will ever update. Pin the version explicitly to a release tag

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