Not able to mount shared path (UNC SFTP path) to docker containers

I went through all the internet resources and all AI/GPT help
Tried all most all methods to mount the shared sftp path to my docker container.

docker run --network host -v //dmns.domain-eg .com/shared:/app -it ubuntu bash

not able to see any files or folders inside /app

I also tried by using volumes

docker volume create ^
–driver local ^
–opt type=cifs ^
–opt device=//dmns.domain-eg.com/shared ^
–opt o=addr=dmns.domain-eg.com,username=ganesh,password=pass,file_mode=0777,dir_mode=0777 ^
sftpMunt

docker run --network host -it --mount type=volume,source=sftpMunt,target=/mnt ubuntu bash

still not able to mount!!!

@Docker please help to solve the issue.

You can’t use a unc path as parameter for the -v argument.
Indeed it needs to be declared as volume baked by cifs.

This should work in Linux:

docker volume create \
--driver local \
--opt type=cifs \
--opt device=//xxx.xxx.xxx.xxx/share \
--opt o=username=ganesg,password=pass,uid=xxxx,gid=xxx,vers=3.0 \
sftpMunt

I am not sure, if the host part in the unc path can be a domain name, or must be an ip.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.