This Docker image sets up Dropbear inside a docker container that allows remote backups using Borg, rsync or sftp-server
Dropbear is a relatively small SSH server that runs on a variety of unix platforms.
Borg is a deduplicating backup software for various Unix-like operating systems.
rsync is a utility for efficiently transferring and synchronizing files between a computer and a storage drive and across networked computers.
sftp-server is a program that speaks the server side of SFTP protocol to stdout and expects client requests from stdin.
To use docker-dropbear-backup, follow these steps:
-
Clone and start the container:
docker run -p 2222:22 \ -e BACKUP_USER=bob \ -e BACKUP_UID=1000 \ -v "${PWD}"/dropbear:/etc/dropbear \ -v "${PWD}"/backups:/home/bob \ docker.io/aguslr/dropbear-backup:latest
-
Configure your backup software to connect to your Dropbear server's IP address on port
2222
with userBACKUP_USER
.
The image is configured using environment variables passed at runtime. All these
variables are prefixed by BACKUP_
.
Variable | Function | Default | Required |
---|---|---|---|
USER |
New user that will own the backups | rbackup |
N |
UID |
UID of the new user | 11000 | N |
To allow certain users to use the server for backup, we can copy the SSH keys
into the authorized_keys
file (e. g. "${PWD}"/backups/.ssh/authorized_keys
)
with the format:
no-agent-forwarding,no-port-forwarding,no-pty,no-X11-forwarding SSH_KEY USER@HOST
Instead of pulling the image from a remote repository, you can build it locally:
-
Clone the repository:
git clone https://github.com/aguslr/docker-dropbear-backup.git
-
Change into the newly created directory and use
docker-compose
to build and launch the container:cd docker-dropbear-backup && docker-compose up --build -d