Feb 1 2023

How to map windows network share folder in a docker container

Category: — Duke @ 09:29

Note to myself: with the current docker desktop for windows version, if it is required to mount a network share (SAMBA) inside the contaiiner the following should be done

docker volume create --driver local --opt type=cifs --opt device=//networkdrive-IP/Folder --opt o=user=yourusername,domain=yourdomain,password=yourpassword,file_mode=0777,dir_mode=0777 VolumeName
docker run -it -v VolumeName:/home/Volume --name my-container ImageName

Very important: looks like that the containers (out of the box)  cannot resolve names so the ip of the server that shares the folder should be usedinstead of its network name.

Tags:

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading