Skip to content

Commit

Permalink
fix: add tini to docker images to reap rclone processes left behind b…
Browse files Browse the repository at this point in the history
…y restic
  • Loading branch information
garethgeorge committed Apr 18, 2024
1 parent be09303 commit 6408518
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM alpine:latest
RUN apk --no-cache add ca-certificates curl bash rclone openssh tzdata
RUN apk --no-cache add tini ca-certificates curl bash rclone openssh tzdata
RUN mkdir -p /tmp
COPY backrest /backrest
RUN /backrest --install-deps-only
RUN mkdir -p /bin && mv /root/.local/share/backrest/* /bin

ENTRYPOINT ["/backrest"]
RUN /backrest --install-deps-only
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["/backrest"]
15 changes: 9 additions & 6 deletions Dockerfile.scratch
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
FROM golang:alpine as gobuild
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/* /bin

FROM scratch
COPY --from=gobuild /tmp-orig /tmp
COPY --from=gobuild /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=gobuild /bin /bin
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

ENTRYPOINT ["/backrest"]
COPY backrest /backrest
ENTRYPOINT ["/tini", "--"]
CMD ["/backrest"]

0 comments on commit 6408518

Please sign in to comment.