forked from garethgeorge/backrest
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.scratch
More file actions
29 lines (22 loc) · 885 Bytes
/
Copy pathDockerfile.scratch
File metadata and controls
29 lines (22 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# 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"]