A rsyncd
server/client in Docker. You know, for moving files.
Start a server
$ docker run \
--name rsync-server \ # Name it
-p 8000:873 \ # rsyncd port
-e USERNAME=user \ # rsync username
-e PASSWORD=pass \ # rsync password
thann/rsync
Warning If you are exposing services to the internet be sure to change the default password from pass
by settings the environmental variable PASSWORD
.
Please note that data
is the rsync
volume pointing to /data
. The data
will be at /data
in the container. Use the VOLUME
parameter to change the
volume name in rsync. Even when changing VOLUME
, you will still
rsync
to /data
. It is recommended that you always change the default password of pass
by setting the PASSWORD
environmental variable, even if you are using key authentication.
$ rsync -av /your/folder/ rsync://user@localhost:8000/data
Password: pass
sending incremental file list
./
foo/
foo/bar/
foo/bar/hi.txt
sent 166 bytes received 39 bytes 136.67 bytes/sec
total size is 0 speedup is 0.00
Variable options (on run)
USERNAME
- thersync
username. defaults touser
PASSWORD
- thersync
password. defaults topass
VOLUME
- the name of thersync
module, defaults todata
.ALLOW
- space separated list of allowed sources. defaults to192.168.0.0/16 172.16.0.0/12
.
$ docker run -p 873:873 thann/rsync
$ docker run -p 873:873 -v /your/folder:/data thann/rsync
$ docker run \
-p 873:873 \
-v /your/folder:/data \
-e USERNAME=admin \
-e PASSWORD=mysecret \
thann/rsync
$ docker run \
-p 9999:873 \
-v /your/folder:/data \
-e USERNAME=admin \
-e PASSWORD=mysecret \
thann/rsync
$ rsync rsync://admin@localhost:9999
volume /data directory
$ docker run \
-p 9999:873 \
-v /your/folder:/myvolume \
-e USERNAME=admin \
-e PASSWORD=mysecret \
-e VOLUME=myvolume \
thann/rsync
$ rsync rsync://admin@localhost:9999
volume /myvolume directory
$ docker run \
-p 9999:873 \
-v /your/folder:/myvolume \
-e USERNAME=admin \
-e PASSWORD=mysecret \
-e VOLUME=/myvolume \
-e ALLOW=192.168.8.0/24 192.168.24.0/24 172.16.0.0/12 127.0.0.1/32 \
thann/rsync
Receiving data over SSH is not supported by this server!