in general, it is very easy to mount folders from local/host to container
Any suggestions to mount folder inside container to local/host like
@thuylevn I found this somewhere you can try this.
You could do this using the docker-machine mount command.
Using this command,you can mount directories from a machine to your local host, using sshfs.
The notation is machinename:/path/to/dir for the argument; you can also supply an alternative mount point (default is the same dir path).
consider an example:
$ mkdir foo $ docker-machine ssh dev mkdir foo $ docker-machine mount dev:/home/docker/foo foo $ touch foo/bar $ docker-machine ssh dev ls foo bar
Now you can use the directory on the machine, for mounting into containers. Any changes done in the local directory, is reflected in the machine too.
$ eval $(docker-machine env dev) $ docker run -v /home/docker/foo:/tmp/foo busybox ls /tmp/foo bar $ touch foo/baz $ docker run -v /home/docker/foo:/tmp/foo busybox ls /tmp/foo bar baz
The files are actually being transferred using sftp (over an ssh connection).