How can I mount a volume of files to a remote docker daemon?

This is an answer to my own question.

I found the following pure Docker approach. I was looking for a way to copy files to a volume directly, but that does not seem to be supported for some reason?

You can copy files to a container however. So the following works:

 export DOCKER_HOST=tcp://remote_host:2375
 docker volume create data-volume
 docker create -v data-volume:/data --name helper busybox true
 docker cp /home/Bradson/data helper:/data
 docker rm helper
 docker run -v data-volume:/data a

This is inspired by https://stackoverflow.com/a/37469637/10042924.

Leave a Comment

tech