Files
backrest/Dockerfile.scratch
avery d6f6875771
Docs / build (push) Waiting to run
Docs / deploy (push) Blocked by required conditions
Release Please / release-please (push) Waiting to run
Release Preview / call-reusable-release (push) Waiting to run
Test / test-nix (push) Waiting to run
Test / test-win (push) Waiting to run
chore: upgrade to goreleaser v2 (#1208)
Co-authored-by: Gareth <garethgeorge97@gmail.com>
2026-05-02 22:51:23 -07:00

30 lines
885 B
Docker

# Stage 1: Dependencies (Alpine)
FROM alpine:latest AS alpine
RUN apk add --no-cache ca-certificates tini-static
RUN mkdir /tmp-orig
ARG TARGETPLATFORM
# Binaries are staged per-platform by goreleaser dockers_v2
COPY $TARGETPLATFORM/backrest /backrest
RUN /backrest --install-deps-only
# Setup restic path
RUN mkdir -p /bin && mv /root/.local/share/backrest/restic /bin/restic
# Stage 2: Final Image (Scratch)
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/restic /bin/restic
COPY --from=alpine /sbin/tini-static /tini
ARG TARGETPLATFORM
COPY $TARGETPLATFORM/backrest /backrest
COPY $TARGETPLATFORM/docker-entrypoint /docker-entrypoint
ENTRYPOINT ["/tini", "--", "/docker-entrypoint"]
CMD ["/backrest"]