Docker VOLUME directories are local directories on the docker host.
Hence, when using docker-machine
with remote hosts they are not available.
However, we can rsync files to the remote docker host and MOUNT them from there
Assuming rs
is a directory, this copies its contents to the home directory of the default user (ubuntu) on the remote docker-machine
with the name my-sandbox
. :
denotes the remote machine, with no path it defaults to the current directory of the shell
(the ubuntu user's home directory).
rsync -av -e 'docker-machine ssh my-sandbox' rs :
rsync is a Linux file-copying tool - https://linux.die.net/man/1/rsync. so it is one-time.