Docker Community Forums

Share and learn in the Docker community.

Possible to share only portion of Drive?

I’m hoping I don’t get flamed for this one, but I have searched and perused the docker docs and the open and closed docker issues before posting.

I’d like to share portions of my hard drive with Docker to be able to mount volumes in my containers. From Docker Desktop, I’m only presented with options of sharing an entire drive. This has been problematic for me becuase a) I’m on an enterprise system that uses a smart card for authentication (no password), b) I don’t have administrator privileges, and c) our enterprise doesn’t allow local accounts. For any of these reasons but potentially others, I’m unable to share my drive with Docker, and receive the following error message when trying to run containers with mounted volumes:

PS C:\Users\myuser> docker run -it --rm -v /c/Users/myuser/Downloads:/tmp ubuntu:latest /bin/bash
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: Drive sharing failed for an unknown reason.
See 'C:\Program Files\Docker\Docker\Resources\bin\docker.exe run --help'.

Naively, I don’t want Docker to have access to my entire drive - my user directory is more than enough, and that would mean that my account would have access, and all would be good.

Is there a way to have Docker Desktop share only my user directory (C:\Users\myuser in this example)?