2017-10-19 17:41:41 +00:00
|
|
|
############################################################
|
|
|
|
# Dockerfile to build borgbackup server images
|
|
|
|
# Based on Debian
|
|
|
|
############################################################
|
2018-11-12 14:04:21 +00:00
|
|
|
FROM debian:buster-slim
|
2017-10-19 17:41:41 +00:00
|
|
|
|
|
|
|
# Volume for SSH-Keys
|
|
|
|
VOLUME /sshkeys
|
|
|
|
|
|
|
|
# Volume for borg repositories
|
|
|
|
VOLUME /backup
|
|
|
|
|
2017-10-27 09:29:02 +00:00
|
|
|
ENV DEBIAN_FRONTEND noninteractive
|
|
|
|
|
2018-11-12 14:04:21 +00:00
|
|
|
RUN apt-get update && apt-get -y --no-install-recommends install \
|
2020-03-26 17:16:56 +00:00
|
|
|
borgbackup openssh-server && apt-get clean && \
|
2019-12-01 16:56:05 +00:00
|
|
|
useradd -s /bin/bash -m -U borg && \
|
2018-11-12 14:04:21 +00:00
|
|
|
mkdir /home/borg/.ssh && \
|
|
|
|
chmod 700 /home/borg/.ssh && \
|
2019-12-01 16:56:05 +00:00
|
|
|
chown borg:borg /home/borg/.ssh && \
|
2018-11-12 14:04:21 +00:00
|
|
|
mkdir /run/sshd && \
|
|
|
|
rm -f /etc/ssh/ssh_host*key* && \
|
|
|
|
rm -rf /var/lib/apt/lists/* /var/tmp/* /tmp/*
|
2017-10-19 17:41:41 +00:00
|
|
|
|
|
|
|
COPY ./data/run.sh /run.sh
|
|
|
|
COPY ./data/sshd_config /etc/ssh/sshd_config
|
2020-03-23 11:38:34 +00:00
|
|
|
COPY ./data/update-ssh-keys.sh /usr/local/bin/
|
|
|
|
COPY ./data/create-client-dirs.sh /usr/local/bin/
|
|
|
|
COPY ./data/env.sh /usr/local/bin/env.sh
|
2017-10-19 17:41:41 +00:00
|
|
|
|
2017-11-01 16:51:51 +00:00
|
|
|
ENTRYPOINT /run.sh
|
2017-10-19 17:41:41 +00:00
|
|
|
|
|
|
|
# Default SSH-Port for clients
|
|
|
|
EXPOSE 22
|