This repository contains the necessary files to build the 'cdx-sync-sshd' Docker image. The image can host a SSH server that receives rsync sessions from cdx-sync-client.
The first time the container is run it will generate a keypair and store it on /etc/ssh/keys
. This directory should be externally mapped to make the keys persistent.
The user cdx-sync is preconfigured and it's expected that the remote client will connect using it as the login name.
To build the Docker image you can use docker build .
directly or run make
which will create the image and tag it with the instedd/cdx-sync-sshd name.
There is a configured repository in Docker Hub that automatically build an image every time the repository receives a push.
Docker compose configuration is included. To build and start the container run: docker-compose up
on the project directory.
At the server or if you prefer to not checkout this repository and build the image yourself, the container can be run pulling the image from the Docker registry:
$ docker pull instedd/cdx-sync-sshd
$ docker run -it --rm \
-p 2222:22 \
-v /path/to/keys:/etc/ssh/keys \
-v /path/to/ssh:/home/cdx-sync/.ssh \
-v /path/to/sync:/home/cdx-sync/tmp/sync \
instedd/cdx-sync-sshd
If you are running from a Mac with boot2docker
ports exported by docker will not be exposed to you machine by default. Check this issue.
If you have deployed your server locally, you can check ssh connection setup is working propertly by running
ssh cdx-sync@localhost -p 2222