dockerfiles/restic-psql

18 lines
842 B
Plaintext
Raw Normal View History

2024-05-29 01:30:15 +00:00
FROM postgres:16
RUN apt-get update -yy && \
apt-get install -yy curl ca-certificates bzip2 sqlite3 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
2024-07-10 23:05:42 +00:00
ARG RESTIC_VERSION=0.16.5
2024-05-29 01:30:15 +00:00
ARG TARGETPLATFORM
2024-07-10 23:05:42 +00:00
RUN if [ ${TARGETPLATFORM} = "linux/amd64" ]; then SUFFIX=linux_amd64; HASH=f1a9c39d396d1217c05584284352f4a3bef008be5d06ce1b81a6cf88f6f3a7b1; \
elif [ ${TARGETPLATFORM} = "linux/arm64" ]; then SUFFIX=linux_arm64; HASH=41cc6ad3ac5e99ee088011f628fafcb4fa1e4d3846be2333e5c2a3f6143cd0c1; \
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