Docker Community Forums

Share and learn in the Docker community.

Docker File Share with Linux Container


(Gfurick) #1

I am attempting to share files between my Windows 10 host running latest windows update, latest stable version of docker and Linux container running Ubuntu 16.04 with latest updates. The volumes option doesn’t allow you to share pre-existing files on the container with the host. How Can I expose an existing folder with files on the container to the host for editing?

I was able to use the route add command to be able to access the webserver running in the container from the windows host over the exposed port. I use 172 subnets so I modified the traditional route add statement.

route add 172.17.0.0 MASK 255.255.255.0 10.0.75.2

The other option I tried was to run samba on the container and access from windows but when i try to expose port 445 on container run it complains the port is already in use by the host. If there is no built-in docker option to share files, how else could i use/configure samba on container to share files with windows host?

Am I hitting known issues, doing something wrong? Ideas? I’m trying to do local AWS serverless development using the linux VM to run the services and webserver and the windows host to edit files using an IDE over some volume/mount/share.


(Archimedes Trajano) #2

I wrote a plugin to deal with this issue https://hub.docker.com/r/trajano/nfs-volume-plugin/