Error while sharing local disk (volume) with docker for windows
I am getting below error when I try to share local disk (volume) with docker for windows
docker run --rm -v c:/Users:/data alpine ls /data
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: C: drive is not shared. Please shar
e it in Docker for Windows Settings.
See 'C:\Program Files\Docker\Docker\Resources\bin\docker.exe run --help'.
I tried to share docker preferences folder and provided my username and password but no luck and didnt get the same error
source to share
At the moment, the Creators Update (1703) does not have Samba shares. There are many tickets in the official repo:
For example: # 662 , # 669 , # 756
The workaround is described here :
Same started for me after installing Win 10 Developer Update (Build 15063)
Firewall rules are not a problem, they are correct for some reason after reboot I cannot access local SMB shares on DockerNAT frontend (10.0.75.1)
I can fix this temporarily by disabling and re-enabling the "File and Printer Sharing for Microsoft Networks" component in the DockerNAT virtual network interface. after that I can view \ 10.0.75.1 disable and enable shared drive in Docker settings and it works - until next reboot
source to share
I faced a similar issue when running containers with docker-compose. I got the error:
The firewall is blocking file sharing between Windows and containers.
Then I checked the settings for Docker and in the Shared Drives section tried to check the box for the C: drive, but after clicking the Apply checkbox it unchecked the box.
Then I copied the docker run --rm -vc: /Users: /data alpine ls/data
lines docker run --rm -vc: /Users: /data alpine ls/data
into Powershell, ran it and got the error:
Disk sharing failed for an unknown reason.
But after this error, I decided to just try restarting Docker. After rebooting, I tried to check the box under Shared Drives again and now it remains checked and everything works as it should.
I used the stable version of Docker.
source to share
I was dealing with a similar issue during installation. I couldn't share my directories with Docker because I used my Azure AD login credentials. You need to create a local administrator. If the local admin doesn't show up right away, you need to reinstall Docker under the local admin. I hope this helps someone to deal with a similar problem.
source to share