classicswarm
classicswarm copied to clipboard
Volume mounting a file or directory that doesnt exist creates a directory
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.