forked from Nold360/docker-borgserver
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Containerfile
33 lines (27 loc) · 933 Bytes
/
Containerfile
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
############################################################
# Dockerfile to build borgbackup server images
# Based on Debian
############################################################
FROM debian:bookworm-slim
# Volume for SSH-Host-Keys
VOLUME /keys
# Volume for borg repositories
VOLUME /backup
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get -y --no-install-recommends install \
borgbackup openssh-server && \
apt-get -y dist-upgrade && apt-get clean && \
useradd -s /bin/bash -m -U borg && \
mkdir /home/borg/.ssh && \
chmod 700 /home/borg/.ssh && \
touch /home/borg/.ssh/authorized_keys && \
chown -R borg:borg /home/borg /backup && \
mkdir /run/sshd && \
rm -f /etc/ssh/ssh_host*key* && \
rm -rf /var/lib/apt/lists/* /var/tmp/* /tmp/*
COPY ./data/sshd_config /etc/ssh/sshd_config
COPY ./data/init.sh /init.sh
USER borg
EXPOSE 2222
CMD [ "/usr/sbin/sshd", "-D", "-e" ]