Go to file
b3vis d5e1d8b758
Merge pull request #5 from b3vis/main
Main
2021-12-29 08:25:38 +00:00
.github Typo 2021-12-29 08:23:20 +00:00
.dockerignore Updated README 2016-08-15 09:45:46 +01:00
.gitignore Updated README 2016-08-15 09:45:46 +01:00
Dockerfile Added GHA and switching to main branch as default. Also set /etc/ssh to be a volume 2021-12-29 08:22:29 +00:00
README.md yet another commit 2020-05-28 11:41:16 +02:00
service.sh make sure ssh-host-keys get created during container start and are not 2020-05-28 12:07:29 +02:00
supervisord.conf make sure ssh-host-keys get created during container start and are not 2020-05-28 12:07:29 +02:00

README.md

Borg Backup Server Container

alt text

Description

My take on a Borgbackup Server as a Docker container to faciliate the backing up of remote machines using Borgbackup

Dockerfile

FROM alpine:latest
MAINTAINER b3vis
#Install Borg & SSH
RUN apk add openssh sshfs borgbackup supervisor --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/
RUN adduser -D -u 1000 borg && \
    ssh-keygen -A && \
    mkdir /backups && \
    chown borg.borg /backups && \
    sed -i \
        -e 's/^#PasswordAuthentication yes$/PasswordAuthentication no/g' \
        -e 's/^PermitRootLogin without-password$/PermitRootLogin no/g' \
        /etc/ssh/sshd_config
COPY supervisord.conf /etc/supervisord.conf
RUN passwd -u borg
EXPOSE 22
CMD ["/usr/bin/supervisord"]

Usage

I personally like to split my ssh keys out of the main container to make updates and management easier. To achieve this I create a persistent storage container;

docker run -d -v /home/borg/.ssh --name borg-keys-storage busybox:latest

  • Container Creation:
docker create \
  --name=borg-server \
  --restart=always \
  --volumes-from borg-keys-storage \
  -v path/to/backups:/backups \
  -p 2022:22 \
  b3vis/borg-server

Note

After creating the container you will need to start the container add your own public keys.