rsync + ssh server, with ro/rw modes
2.4K
Once configured to accept one or more ssh keys, it will permit one to use rsync+ssh to store data or to read data to/from the docker container.
The container is exporting:
/data volumedocker build --rm -t ssh-rsync-image .
ssh-keygen -t rsa -f ~/.ssh/id_rsa_rsync -N ''
docker run -itdP -p 22222:22 -v ~/data:/data -e AUTHORIZED_KEYS="rw:`cat ~/.ssh/id_rsa_rsync.pub`" --name ssh-rsync-server ssh-rsync-image
docker logs ssh-rsync-server
/etc to remote /data/etc (note: all paths are always relative to /data)rsync -av -e "ssh -i $HOME/.ssh/id_rsa_rsync -p 22222" /etc [email protected]:/
Exemple: AUTHORIZED_KEYS="rw:myfirstkey, ro:mysecondkey"
Inspired by:
Content type
Image
Digest
Size
15.2 MB
Last updated
over 10 years ago
docker pull zas666/docker-rsyncssh