- An rsync docker volume plugin just for the fun of it.
- This is my first Go program (I am learning).
- I don't have a master plan for this project.
The volume driver parses the --volume
flag wich has the format <remote host>/<remote path>:<container path>
. The driver synchronizes (pulls) the data so it can be bind-mounted to the container. When the container is terminated the driver synchronizes (pushes) the data back to the remote host.
go get github.com/h0tbird/docker-volume-rsync
go install github.com/h0tbird/docker-volume-rsync
sudo docker-volume-rsync \
--archive \
--compress \
--delete \
--ssh-private-key /root/.ssh/data.key
docker run -it --volume-driver rsync -v remote.host.org/foo:/foo alpine sh
I learn by copying and pasting someone else's code and adjusting it to my needs (stackoverflow also helps). This wouldn't have been possible without the code I borrowed from David Calavera and Matthias Kadenbach so thank you!