Issue Description:
When using bind mounts that are nested on the container side, Docker erroneously creates empty directories that match the nested structure on the host side.
Output of docker version:
Client:
Version: 1.12.0
API version: 1.24
Go version: go1.6.3
Git commit: 8eab29e
Built: Thu Jul 28 21:15:28 2016
OS/Arch: darwin/amd64
Server:
Version: 1.12.0
API version: 1.24
Go version: go1.6.3
Git commit: 8eab29e
Built: Thu Jul 28 21:15:28 2016
OS/Arch: linux/amd64
Output of docker info:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 4
Server Version: 1.12.0
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 34
Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: host null overlay bridge
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: seccomp
Kernel Version: 4.4.15-moby
Operating System: Alpine Linux v3.4
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 1.954 GiB
Name: moby
ID: X63G:YAIL:6A3B:CAIG:RY7T:YD5J:56WM:OAJ3:MJ27:YSN4:6G5D:ZVJJ
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
File Descriptors: 19
Goroutines: 30
System Time: 2016-08-26T01:01:01.833759981Z
EventsListeners: 1
No Proxy: *.local, 169.254/16
Username: jordanlewis
Registry: https://index.docker.io/v1/
Insecure Registries:
127.0.0.0/8
Additional environment details (AWS, VirtualBox, physical, etc.):
Docker for Mac, OS X El Capitan
Steps to reproduce the issue:
mkdir -p /tmp/foo /tmp/bar
docker run --rm --volume="/tmp/foo:/foo" --volume="/tmp/bar:/foo/bar" ubuntu true
ls -la /tmp/foo
Describe the results you received:
There is an empty directory named bar on the host in /tmp/foo.
Describe the results you expected:
/tmp/foo and /tmp/bar remain empty and untouched on the host.
Additional information you deem important (e.g. issue happens only occasionally):
This happens as well on Linux, but the erroneously created directory is also owned by root.
Issue Description:
When using bind mounts that are nested on the container side, Docker erroneously creates empty directories that match the nested structure on the host side.
Output of
docker version:Output of
docker info:Additional environment details (AWS, VirtualBox, physical, etc.):
Docker for Mac, OS X El Capitan
Steps to reproduce the issue:
mkdir -p /tmp/foo /tmp/bardocker run --rm --volume="/tmp/foo:/foo" --volume="/tmp/bar:/foo/bar" ubuntu truels -la /tmp/fooDescribe the results you received:
There is an empty directory named
baron the host in/tmp/foo.Describe the results you expected:
/tmp/fooand/tmp/barremain empty and untouched on the host.Additional information you deem important (e.g. issue happens only occasionally):
This happens as well on Linux, but the erroneously created directory is also owned by root.