dependabot[bot] efd09398f4 build(deps): bump docker/setup-buildx-action from 2.4.0 to 2.4.1 (#40) | 1 gadu atpakaļ | |
---|---|---|
.github | 1 gadu atpakaļ | |
CHANGELOG.md | 2 gadi atpakaļ | |
Dockerfile | 1 gadu atpakaļ | |
Makefile | 3 gadi atpakaļ | |
README.md | 3 gadi atpakaļ | |
docker-compose.yml | 3 gadi atpakaļ | |
entrypoint.sh | 3 gadi atpakaļ | |
mariadb-client-package-log.url | 2 gadi atpakaļ | |
openssh-package-log.url | 2 gadi atpakaļ | |
openssh-release-notes.url | 3 gadi atpakaļ | |
rsnapshot.conf.example | 3 gadi atpakaļ | |
sshd_config | 2 gadi atpakaļ | |
tini-package-log.url | 2 gadi atpakaļ |
Create logical backups of mariadb and mysql databases via SSH.
Whenever a SSH client connects mysqldump
will be executed.
Useful to fetch backups via rsnapshot. See rsnapshot.conf.example.
$ sudo docker run --rm --name mysqldump_ssh \
-p 2200:2200 \
-e SSH_CLIENT_PUBLIC_KEYS="$(cat ~/.ssh/id_*.pub)" \
--tmpfs /home/dump/.ssh:mode=1777,size=16k \
-e MYSQLDUMP_ARGS='--host=dbhost --user=dbuser --password=dbpass --all-databases' \
--read-only --security-opt=no-new-privileges --cap-drop=ALL \
docker.io/fphammerle/mysqldump-sshd
$ ssh -p 2200 -T dump@localhost
-- MariaDB dump 10.17 Distrib 10.4.10-MariaDB, for Linux (x86_64)
--
-- Host: database Database: demo
-- ------------------------------------------------------
[…]
Git tags docker/*
contain signed docker image digests:
https://github.com/fphammerle/docker-mysqldump-sshd/tags
⚠️ MYSQLDUMP_ARGS=--password=...
leaks the password to other users on the same machine,
if /proc
is mounted with hidepid=0
(default).
git clone https://github.com/fphammerle/docker-mysqldump-sshd
cd docker-mysqldump-sshd
SSH_CLIENT_PUBLIC_KEYS
and MYSQLDUMP_ARGS
in docker-compose.yml
.docker-compose up --build