-
Notifications
You must be signed in to change notification settings - Fork 18
/
Dockerfile
55 lines (49 loc) · 1.58 KB
/
Dockerfile
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
48
49
50
51
52
53
54
55
FROM tgbyte/ubuntu:24.04
ARG BORG_VERSION
RUN set -x \
&& apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y \
build-essential \
libacl1 \
libacl1-dev \
liblz4-1 \
liblz4-dev \
libssl3t64 \
libssl-dev \
libxxhash0 \
libxxhash-dev \
libzstd1 \
libzstd-dev \
openssh-server \
python3 \
python3-pip \
python3-pkgconfig \
python3-setuptools \
python3-setuptools-scm \
&& rm -f /etc/ssh/ssh_host_* \
&& python3 --version \
&& pip3 install --break-system-packages -v "borgbackup==${BORG_VERSION}" \
&& apt-get remove -y --purge \
build-essential \
libacl1-dev \
liblz4-dev \
libssl-dev \
libxxhash-dev \
libzstd-dev \
&& apt-get autoremove -y --purge \
&& adduser --uid 500 --disabled-password --gecos "Borg Backup" --quiet borg \
&& mkdir -p /var/run/sshd /var/backups/borg /var/lib/docker-borg/ssh mkdir /home/borg/.ssh \
&& chown borg.borg /var/backups/borg /home/borg/.ssh \
&& chmod 700 /home/borg/.ssh \
&& rm -rf /var/lib/apt/lists/*
RUN set -x \
&& sed -i \
-e 's/^#PasswordAuthentication yes$/PasswordAuthentication no/g' \
-e 's/^PermitRootLogin without-password$/PermitRootLogin no/g' \
-e 's/^X11Forwarding yes$/X11Forwarding no/g' \
-e 's/^#LogLevel .*$/LogLevel ERROR/g' \
/etc/ssh/sshd_config
VOLUME ["/var/backups/borg", "/var/lib/docker-borg"]
ADD ./entrypoint.sh /
EXPOSE 22
CMD ["/entrypoint.sh"]