mirror of
https://github.com/garethgeorge/backrest.git
synced 2026-05-04 03:50:30 +00:00
25 lines
785 B
Docker
25 lines
785 B
Docker
FROM golang:1.25-alpine AS builder
|
|
WORKDIR /src
|
|
COPY . .
|
|
RUN go build -o /docker-entrypoint -ldflags "-s -w" ./cmd/docker-entrypoint
|
|
|
|
FROM alpine:latest AS alpine
|
|
RUN apk add --no-cache ca-certificates tini-static
|
|
RUN mkdir /tmp-orig
|
|
COPY backrest /backrest
|
|
RUN /backrest --install-deps-only
|
|
RUN mkdir -p /bin && mv /root/.local/share/backrest/restic /bin/restic
|
|
|
|
FROM scratch
|
|
LABEL org.opencontainers.image.source="https://github.com/garethgeorge/backrest"
|
|
COPY --from=alpine /tmp-orig /tmp
|
|
COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
|
COPY --from=alpine /bin /bin
|
|
COPY --from=alpine /sbin/tini-static /tini
|
|
COPY backrest /backrest
|
|
|
|
COPY --from=builder /docker-entrypoint /docker-entrypoint
|
|
|
|
ENTRYPOINT ["/tini", "--", "/docker-entrypoint"]
|
|
CMD ["/backrest"]
|