Unison File Synchronizer
This repository has been archived on 2026-05-07. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
  • Dockerfile 100%
Find a file
2018-04-29 18:17:31 +02:00
Dockerfile first commit 2018-04-27 15:54:28 +02:00
README.md first commit 2018-04-27 15:54:28 +02:00

Docker Unison

This image runs plain unison as entrypoint. It is adviced to create external docker volume containers for:

  • /path/to/data - the destination of the sync
  • /root/.ssh - the ssh key
  • /root/.unison - the unison working data

If you create a default.prf in the working directory of unison, the docker container would not need any further options and running those default settings.

Setup

create a data volume container for the data to synchronize

sudo docker create -v /path/to/data --name synceddata ubuntu

create a data volume container for the ssh key and register the key on the remote server

sudo docker run -it --name sshdata thomass/ssh-client ssh-keygen -t rsa -C "key for docker unison"
sudo docker run -it --rm --volumes-from sshdata thomass/ssh-client ssh-copy-id [-p <remote-port>] [<user>@]<remote-ip>

create a data volume container for all unison data

sudo docker create --name unisondata --volumes-from synceddata --volumes-from sshdata -v /root/.unison ubuntu

setup the default sync profile

sudo docker run -it --rm --volumes-from unisondata ubuntu vim.tiny /root/.unison/default.prf

Insert following (example) settings

root = /path/to/data
root = ssh://[<user>@]<remote-ip>[:<remote-port>]//path/to/data

Usage

Now you can run a synchronization any time as following

sudo docker run -it --rm --volumes-from unisondata thomass/unison

Licence

The whole repository is licenced under BSD. Please mention following:

github.com/ThomasSteinbach (thomass at aikq.de)