Docker Version:
Client:
Version: 1.10.3
API version: 1.22
Go version: go1.5.3
Git commit: 20f81dd
Built: Thu Mar 10 15:59:07 2016
OS/Arch: linux/amd64
Server:
Version: 1.10.3
API version: 1.22
Go version: go1.5.3
Git commit: 20f81dd
Built: Thu Mar 10 15:59:07 2016
OS/Arch: linux/amd64
Docker Info:
Containers: 2
Running: 0
Paused: 0
Stopped: 2
Images: 1492
Server Version: 1.10.3
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 1629
Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Plugins:
Volume: local
Network: host bridge null
Kernel Version: 4.2.0-34-generic
Operating System: Ubuntu 15.10
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 11.69 GiB
Name: shieldse
ID: YP6D:47KS:3QMK:C472:JSZL:N24F:YG7V:GJYL:FP67:PYHO:XBSO:UACR
Http Proxy: http://web-proxy.corp.hp.com:8080
Https Proxy: http://web-proxy.corp.hp.com:8080
No Proxy: /var/run/docker.sock,localhost,127.0.0.1
WARNING: No swap limit support
If i run docker run -it -vpwd/myconfig.conf:/myconfig.conf busybox
but there is no myconfig.conf on the filesystem a local directory called myconfig.conf is created and a mounted directory in the container is created. It should fail when this happens. The worst case scenario for this is when you are trying to mount a file, as the file does not exist on the filesystem but its mounted as a directory in the container. If you get into the situation where the file later exists on the filesystem but the mount is still a directory then this crashes the container.
This is expected behavior and does not look like it's going to change. I've tried to get this functionality deprecated and it is decided it's too much of a breaking change... and that's probably correct.
In terms of mounting a file, the right way to do this is to make sure a file exists before running your container. This can be a simple touch /foo.conf && docker run -v /foo.conf:/foo.conf ...
Closing this as wontfix.
Most helpful comment
This is expected behavior and does not look like it's going to change. I've tried to get this functionality deprecated and it is decided it's too much of a breaking change... and that's probably correct.
In terms of mounting a file, the right way to do this is to make sure a file exists before running your container. This can be a simple
touch /foo.conf && docker run -v /foo.conf:/foo.conf ...
Closing this as wontfix.