Skip to content

Commit 9a85539

Browse files
committed
fix: Simplify Dockerfile and make it compatible with goreleaser
1 parent 756701b commit 9a85539

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

Dockerfile

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
1-
FROM alpine:latest as alpine
1+
FROM alpine:latest AS alpine
22

3-
RUN apk add -U --no-cache ca-certificates
3+
# We need git to automatically get the changes of a deployment
4+
RUN apk add -U --no-cache ca-certificates git
45

5-
# Build a statically linked git binary
6-
ENV GIT_VERSION "v2.30.0"
7-
WORKDIR /tmp/git
8-
RUN apk add -U --no-cache git alpine-sdk autoconf automake zlib-dev zlib-static zlib
9-
RUN \
10-
git clone --depth=1 git://github.com/git/git -b $GIT_VERSION /tmp/git && \
11-
make configure && \
12-
./configure prefix=/tmp CFLAGS="${CFLAGS} -static" && \
13-
make install NO_TCLTK="YesPlease"
6+
# See https://goreleaser.com/customization/dockers_v2/#how-it-works
7+
ARG TARGETPLATFORM
148

15-
FROM scratch
169
WORKDIR /workdir
17-
COPY pulse-event-cli /bin/
18-
COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
19-
COPY --from=alpine /tmp/bin/git /bin/git
10+
COPY $TARGETPLATFORM/pulse-event-cli /bin/
2011
ENTRYPOINT ["pulse-event-cli"]

0 commit comments

Comments
 (0)