moby: Unable to map files into Windows container
Expected behavior
Mapping a file should show the file in the container.
Actual behavior
Mapping a file or a directory both work on Linux. Mapping a file fails on Windowsm with Windows Containers.
Information
Docker: 1.13.0-rc5-beta35 (9606) OS: Windows 10 (1607 - Anniversary edition) and Windows Server 2016 with containers (Azure)
Steps to reproduce the behavior
docker run -v C:\users\ramon\test:C:\test nanoserver cmd /c dir \
Error response from daemon: invalid bind mount spec "C:\\users\\ramon\\test.config:C:\\test.config": invalid volume specification: 'C:\users\ramon\test.config:C:\test.config': invalid mount config for type "bind": source path must be a directory.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 3
- Comments: 15 (8 by maintainers)
Links to this issue
Commits related to this issue
- (maint) For run_agent map /etc/hosts in from LCOW - LCOW has a bug where --add-host is not supported for `docker run` and extra_hosts is not supported for docker-compose.yml: https://github.co... — committed to Iristyle/pupperware by Iristyle 5 years ago
- (maint) For run_agent map /etc/hosts in from LCOW - LCOW has a bug where --add-host is not supported for `docker run` and extra_hosts is not supported for docker-compose.yml: https://github.co... — committed to Iristyle/pupperware by Iristyle 5 years ago
- Don't use subPath on windows: https://github.com/moby/moby/issues/30555 — committed to rene-dekker/operator by rene-dekker a year ago
- Don't use subPath on windows: https://github.com/moby/moby/issues/30555 — committed to rene-dekker/operator by rene-dekker a year ago
- Don't use subPath on windows: https://github.com/moby/moby/issues/30555 — committed to rene-dekker/operator by rene-dekker a year ago
- Don't use subPath on windows: https://github.com/moby/moby/issues/30555 — committed to rene-dekker/operator by rene-dekker a year ago
- Don't use subPath on windows: https://github.com/moby/moby/issues/30555 (#2743) — committed to tigera/operator by rene-dekker a year ago
- Don't use subPath on windows: https://github.com/moby/moby/issues/30555 (#2744) — committed to tigera/operator by rene-dekker a year ago
- Don't use subPath on windows: https://github.com/moby/moby/issues/30555 (#2745) — committed to tigera/operator by rene-dekker a year ago
- Don't use subPath on windows: https://github.com/moby/moby/issues/30555 (#2740) — committed to tigera/operator by rene-dekker a year ago
- Don't use subPath on windows: https://github.com/moby/moby/issues/30555 (#2740) — committed to Tamas-Biro1/operator by rene-dekker a year ago
Unfortunately, it still doesn’t work. I gave it a try on Windows 10 version 1903 (aka Windows 10 May 2019 Update).
For some context on my situtation–
We’re running apps in the legacy .NET framework world (/sad-face) – we have .config files mixed in with our application binaries. We don’t want to build environment-specific containers, so of course, we try to share config files that have been transformed per environment directly inside the container to the location our application expects them.
In case it helps anyone, I have a simple entrypoint.ps1 script hack to get around this issue for now. Share a directory to c:\conf with config files in it, the script will copy them into the app context folder on start: