FROM golang:1.26.5-alpine3.23@sha256:622e56dbc11a8cfe87cafa2331e9a201877271cbff918af53d3be315f3da88cc AS restic

RUN CGO_ENABLED=0 go install github.com/restic/restic/cmd/restic@v0.19.1

FROM alpine:3.23.3@sha256:25109184c71bdad752c8312a8623239686a9a2071e8825f20acb8f2198c3f659

RUN apk add --no-cache \
      ca-certificates=20260611-r0 \
      libcrypto3=3.5.7-r0 \
      libssl3=3.5.7-r0 \
      musl=1.2.5-r23 \
      musl-utils=1.2.5-r23 \
      postgresql18-client=18.4-r0 \
      zlib=1.3.2-r0

COPY --from=restic /go/bin/restic /usr/local/bin/restic

ENTRYPOINT []
USER 10001:10001
CMD ["restic", "version"]
