dockerfiles/restic

20 lines
963 B
Plaintext
Raw Normal View History

2024-11-13 18:05:02 +00:00
# docker buildx build --pull - --platform linux/amd64,linux/arm64 --push --tag quay.io/remram44/restic:0.17.3 < restic
2024-07-31 14:30:29 +00:00
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/*
2024-11-13 18:05:02 +00:00
ARG RESTIC_VERSION=0.17.3
2024-05-29 01:30:15 +00:00
ARG TARGETPLATFORM
2024-11-13 18:05:02 +00:00
RUN if [ ${TARGETPLATFORM} = "linux/amd64" ]; then SUFFIX=linux_amd64; HASH=5097faeda6aa13167aae6e36efdba636637f8741fed89bbf015678334632d4d3; \
elif [ ${TARGETPLATFORM} = "linux/arm64" ]; then SUFFIX=linux_arm64; HASH=db27b803534d301cef30577468cf61cb2e242165b8cd6d8cd6efd7001be2e557; \
2024-05-29 01:30:15 +00:00
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