I am trying to create a volume for my docker applications. My docker application would need to access a folder that is located on a unraid server (SMB). I can access my remote folder from my windows 10 computer using a VPN. Note the the server is located on a different IP address as my local computer.
I created the following docker-compose.yml file as follow
services:
Test:
image: python
volumes:
- database:/database
volumes:
database:
driver_opts:
type: cifs
o: "username=username,password=password,file_mode=0777,dir_mode=0777,vers=3.0"
device: "//my.server.ip.address/Database"
Now as I am logged into my windows VPN and run docker compose -f "docker-compose.yml" up -d --build
, I get :
Error response from daemon: error while mounting volume '/var/lib/docker/volumes/test_database/_data': failed to mount local volume: mount //xxx.xxx.x.xx/Database:/var/lib/docker/volumes/test_database/_data, data: username=xxxx,password=xxxx,file_mode=0777,dir_mode=0777,vers=3.0: permission denied
I have tried many of the the proposed solution on the internet, namely trying different version, different file mode or dir mode but I am still stuck.
Does anyone has a solution for this ? Should I install a VPN from inside the docker container to have access to the folder ?
Does anyone has an idea where the issue could come from ?
I am relatively new to docker so any help would be greatly appreciated !