-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
24 lines (23 loc) · 873 Bytes
/
Dockerfile
File metadata and controls
24 lines (23 loc) · 873 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
FROM golang:alpine AS builder
ARG RESTIC_VERSION="0.12.1"
ENV CGO_ENABLED=0
WORKDIR /build
RUN set -eu; \
archive="restic-${RESTIC_VERSION}.tar.gz"; \
checksums="SHA256SUMS"; \
wget --quiet "https://github.com/restic/restic/releases/download/v${RESTIC_VERSION}/restic-${RESTIC_VERSION}.tar.gz"; \
wget --quiet "https://github.com/restic/restic/releases/download/v${RESTIC_VERSION}/$checksums"; \
grep "$archive" "$checksums" | sha256sum -c -s; \
if [ $? -ne 0 ]; then echo 'restic checksum is not valid' >&2; exit 1; fi; \
tar -zxf "$archive" --strip-components=1; \
rm -f "$archive"; \
rm -f "$checksums"
RUN go run -mod=vendor build.go
FROM ghcr.io/acrobox/docker/minimal:latest
ENV RESTIC_CACHE_DIR="/cache"
VOLUME /data
VOLUME /cache
COPY --from=builder /build/restic /usr/local/bin/restic
USER user
ENTRYPOINT ["/usr/local/bin/restic"]
CMD ["help"]