dockerfiles/restic

18 lines
843 B
Plaintext
Raw Normal View History

2024-05-29 01:30:15 +00:00
FROM ubuntu:22.04
RUN apt-get update -yy && \
apt-get install -yy curl ca-certificates bzip2 sqlite3 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ARG RESTIC_VERSION=0.16.4
ARG TARGETPLATFORM
RUN if [ ${TARGETPLATFORM} = "linux/amd64" ]; then SUFFIX=linux_amd64; HASH=3d4d43c169a9e28ea76303b1e8b810f0dcede7478555fdaa8959971ad499e324; \
elif [ ${TARGETPLATFORM} = "linux/arm64" ]; then SUFFIX=linux_arm64; HASH=9d2f44538ea0c6309426cb290d3a6b8b0b85de5de7f1496ff40c843b36bf8a8d; \
else echo "no URL for $(TARGETPLATFORM)"; exit 1; fi && \
curl -Lo /tmp/restic.bz2 https://github.com/restic/restic/releases/download/v${RESTIC_VERSION}/restic_${RESTIC_VERSION}_${SUFFIX}.bz2 && \
printf "${HASH} /tmp/restic.bz2\\n" | sha256sum -c && \
bunzip2 < /tmp/restic.bz2 > /opt/restic && \
chmod +x /opt/restic