I had exactly the same problem, but in my case both volumes were in separate VPCs and could not expose SSH for the outside world. In the end, I created dvsync, which uses ngrok to create a tunnel between them, and then used rsync via SSH to copy the data. In your case, you can run dvsync-server on your machine:
$ docker run --rm -e NGROK_AUTHTOKEN="$NGROK_AUTHTOKEN" \ --mount source=postgres-data,target=/data,readonly \ quay.io/suda/dvsync-server
and then run dvsync-client on the target machine:
docker run -e DVSYNC_TOKEN="$DVSYNC_TOKEN" \ --mount source=MY_TARGET_VOLUME,target=/data \ quay.io/suda/dvsync-client
NGROK_AUTHTOKEN can be found on the ngrok dashboard, and DVSYNC_TOKEN shows dvsync-server in its standard dvsync-server .
As soon as the dvsync-client synchronization, the dvsync-client container stops.
suda Jul 10 '18 at 19:32 2018-07-10 19:32
source share