I am using docker which created on windows 10 (The docker is for linux).
Also, using docker-compose (Version 3.4) to map a volumes that is outside docker into the docker container.
I have a shared folder on another computer, that I want to use in the docker.
I check the access of that folder, and I can access it from the computer the docker is running.
//ip_addr/shared_folder
In docker-compose, I wrote:
volumes:
- //1.2.3.4/my_folder:my_docker_folder
I found some syntax with networks declaration. I don't know how exactly shall I write?
volumes:
- /my_folder:my_docker_folder
networks:
frontend:
ipv4_address: 1.2.3.4
and that ip 1.2.3.4 is the ip for my_folder?
... but this syntax may not be correct, or I should run some commands to share the folder correctly.
What to do in order to map the other computer shared folder to the docker.
I have tried several things, also mapping a symbolic link.
I am trying create a symbolic link in windows 10 and attach it to docker, but this doesn't much helped me, since I encountered into exception.
In windows command line I did:
mklink /D c:\test_ext \\ip\shared_folder
When running the docker (I have the docker community edition Version 18.06.1-ce-win73 (19507) - linux container).
In command line, I have tried to run alpine (that's happens also on other dockers based on linux images):
docker run -i -t -v c:\test_ext:/data:rw alpine /bin/sh I get the error:
docker: Error response from daemon: error while creating mount source path '/host_mnt/c/test_ext': mkdir /host_mnt/c/test_ext: file exists.
That's only happen for external IP.
What I see, is that the folder+subfolders+files is shared with full permissions.
I have tried some work around, such as: docker volumes prune, but this didn't much help.
Why is that error message, and how can I resolve that?
I found also, an alternative that may help:
docker volume create \
--driver local \
--opt type=nfs \
--opt o=addr=ip_address,rw \
--opt device=:/myfolder
my_volume
This doesn't solve the problem either (syntax is wrong).
Thanks.