29 lines
587 B
Docker
29 lines
587 B
Docker
|
FROM --platform=$BUILDPLATFORM golang:1.23.2-alpine AS builder
|
||
|
|
||
|
ARG TARGETOS
|
||
|
ARG TARGETARCH
|
||
|
|
||
|
ENV GOOS=$TARGETOS
|
||
|
ENV GOARCH=$TARGETARCH
|
||
|
|
||
|
RUN apk add --no-cache make git bash
|
||
|
|
||
|
WORKDIR /build
|
||
|
|
||
|
COPY go.mod go.sum /build/
|
||
|
RUN go mod download
|
||
|
RUN go mod verify
|
||
|
|
||
|
COPY . /build/
|
||
|
RUN make build-binary
|
||
|
|
||
|
FROM busybox
|
||
|
LABEL maintainer="Philipp Holzer <admin@philipp.info>"
|
||
|
|
||
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||
|
COPY --from=builder /build/friendica-exporter /bin/friendica-exporter
|
||
|
|
||
|
USER nobody
|
||
|
EXPOSE 9205
|
||
|
|
||
|
ENTRYPOINT ["/bin/friendica-exporter"]
|