forked from Tarsnap/tarsnap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (42 loc) · 1.21 KB
/
Dockerfile
File metadata and controls
47 lines (42 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Use the alpine base image
FROM alpine:latest
# Set non-interactive frontend
ENV DEBIAN_FRONTEND=noninteractive
# Install necessary dependencies
RUN apk add --no-cache \
ca-certificates \
gnupg \
e2fsprogs-dev \
make \
openssl-dev \
perl-digest-sha1 \
perl-utils \
tar \
zlib-dev \
curl \
gnupg \
gcc \
libc-dev \
musl-dev
# Set the Tarsnap version
ENV TARSNAP_VERSION 1.0.39
# Download and verify Tarsnap source code
RUN set -x \
&& curl -sSL "https://www.tarsnap.com/download/tarsnap-autoconf-${TARSNAP_VERSION}.tgz" -o /tmp/tarsnap.tgz \
&& curl -sSL "https://www.tarsnap.com/download/tarsnap-sigs-${TARSNAP_VERSION}.asc" -o /tmp/tarsnap.tgz.asc \
&& curl -sSL "https://www.tarsnap.com/tarsnap-signing-key-2015.asc" | gpg --no-tty --import \
&& sha=$(gpg --decrypt /tmp/tarsnap.tgz.asc | awk '{ print $4 }') \
&& if [ "$sha" != "$(sha256sum /tmp/tarsnap.tgz | awk '{ print $1 }')" ]; then exit 1; fi \
&& mkdir -p /usr/src/tarsnap \
&& tar -xzf /tmp/tarsnap.tgz -C /usr/src/tarsnap --strip-components 1 \
&& rm /tmp/tarsnap.tgz* \
&& ( \
cd /usr/src/tarsnap \
&& ./configure --prefix=/usr \
&& make \
&& make install \
) \
&& rm -rf /usr/src/tarsnap
# Set the entrypoint and command
ENTRYPOINT [ "tarsnap" ]
CMD [ "--help" ]