Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Container volumes - ContainerPath other than C: drive? #334

mwieczorek opened this issue Jul 8, 2016 · 6 comments


Copy link

commented Jul 8, 2016

Is it possible to have other drives in container than C:?
If I run:

docker run -it -v d:\new-data-volume windowsservercore cmd

I get and error:

C:\Docker\docker.exe: Error response from daemon: container 
ad21aac97cd17479a596c302dfe8cb433f425789cc51ff3b5043815730a6ad39 encountered an error during CreateContainer failed in Win32: 
The parameter is incorrect. (0x57) extra info: 

Of course

docker run -it -v c:\new-data-volume windowsservercore cmd



This comment has been minimized.

Copy link

commented Jul 14, 2016

You should be able to get it work with below command: docker run -it --volume=d:\new-data-volume:c:\datavolume windowsservercore cmd


This comment has been minimized.

Copy link
Contributor Author

commented Jul 14, 2016

@rohitjaini Well, that's not what I want.
In your example D:\ is in source (host) and C:\ is in destination (container).
My question is about opposite direction


This comment has been minimized.

Copy link

commented Jul 15, 2016

We support mapping a whole second drive letter, but for now, not portions of it. So you can say

docker run -it -v d: windowsservercore cmd

and get a volume as drive D: in the container. But you can't write d:\data-volume or event d:\; it must be d:.


This comment has been minimized.

Copy link
Contributor Author

commented Jul 16, 2016

@jstarks Thank you for the explanation

@mwieczorek mwieczorek closed this Jul 16, 2016


This comment has been minimized.

Copy link

commented Jul 18, 2016

Thanks @jstarks - I've added this to documentation.

scooley added a commit that referenced this issue Oct 17, 2017

Windows Server version 1709 updates (#334)
* Adding version compatibility page
* Update
Adding information to docker swarm.
* Update
* Starting Docker Swarm workaround
* Adding example swarm failure
* reorder docker swarm to put easiest fix first
* update todo
* Update
Adding details about swarm modifications to run explicitly in hyper-v isolation.
* Update
Adding some clarity for inspecting a container.
* Update
* Added placeholder & link for service constraints
* Adding service constraint example
* Update
* Starting doc for Linux containers
* Adding additional link to Docker EE preview
* Fix markdown around video
* Update INotify
* Starting k8s info
* Starting kubernetes node labels
* Updating k8s samples
* Finishing k8s label example
* Adding Hyper-V isolation for Kubernetes
* Fixing headings and removing a bad section
* Adding link to winspector

This comment has been minimized.

Copy link

commented May 11, 2018

@jstarks, @neilpeterson, @scooley, could you please clarify how non C drive volume mapping should work?
For example:

D:\> mkdir folder
D:\> docker run --rm -it -v D: microsoft/nanoserver:1709 cmd /c "dir D:"
 Directory of D:\

05/11/2018  11:29 AM    <DIR>          .
05/11/2018  11:29 AM    <DIR>          ..
               0 File(s)              0 bytes
               2 Dir(s)  94,127,910,912 bytes free

When starting powershell in the container it fails with a following error:

Attempting to perform the InitializeDefaultDrives operation on the 'FileSystem' provider failed.
dir : Cannot find drive. A drive with the name 'D' does not exist.
At line:1 char:1
+ dir D:
+ ~~~~~~
+ CategoryInfo          : ObjectNotFound: (D:String) [Get-ChildItem], DriveNotFoundException
+ FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

So it looks like it just creates an empty drive D: inside container and does not provide any content from the host filesystem or this drive has problems with permissions to access it.

D:\> docker info
Containers: 4
 Running: 1
 Paused: 0
 Stopped: 3
Images: 11
Server Version: 18.04.0-ce
Storage Driver: windowsfilter (windows) lcow (linux)
Logging Driver: json-file
 Volume: local
 Network: ics l2bridge l2tunnel nat null overlay transparent
 Log: awslogs etwlogs fluentd gelf json-file logentries splunk syslog
Swarm: inactive
Default Isolation: hyperv
Kernel Version: 10.0 16299 (16299.431.amd64fre.rs3_release_svc_escrow.180502-1908)
Operating System: Windows 10 Pro Version 1709 (OS Build 16299.431)
OSType: windows
Architecture: x86_64
CPUs: 8
Total Memory: 63.97GiB
Name: munit-199
Docker Root Dir: C:\ProgramData\Docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: -1
 Goroutines: 30
 System Time: 2018-05-11T11:29:51.2341926+02:00
 EventsListeners: 1
Experimental: true
Insecure Registries:
Live Restore Enabled: false

gitlab-runner-bot pushed a commit to gitlabhq/gitlab-runner that referenced this issue Jul 4, 2019

Document limitation for Windows Docker target drive
When a user specifies `builds_dir=F:\\builds` inside of `config.toml`
file, and run the `docker-windows` executor the user would get an error
like below:

Error response from daemon: The parameter is incorrect.

As explained in
Docker volumes apart from `C:` are not supported.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
5 participants
You can’t perform that action at this time.