{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/26051","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/26051/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/26051/comments","events_url":"https://api.github.com/repos/docker/docker/issues/26051/events","html_url":"https://github.com/docker/docker/issues/26051","id":173508885,"number":26051,"title":"Nested bind mounts create empty directory on the host","user":{"login":"jordanlewis","id":43821,"avatar_url":"https://avatars.githubusercontent.com/u/43821?v=3","gravatar_id":"","url":"https://api.github.com/users/jordanlewis","html_url":"https://github.com/jordanlewis","followers_url":"https://api.github.com/users/jordanlewis/followers","following_url":"https://api.github.com/users/jordanlewis/following{/other_user}","gists_url":"https://api.github.com/users/jordanlewis/gists{/gist_id}","starred_url":"https://api.github.com/users/jordanlewis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordanlewis/subscriptions","organizations_url":"https://api.github.com/users/jordanlewis/orgs","repos_url":"https://api.github.com/users/jordanlewis/repos","events_url":"https://api.github.com/users/jordanlewis/events{/privacy}","received_events_url":"https://api.github.com/users/jordanlewis/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/version/1.12","name":"version/1.12","color":"ededed"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-26T17:59:39Z","updated_at":"2016-08-26T20:44:00Z","closed_at":null,"body":"**Issue Description**:\r\nWhen using bind mounts that are nested on the container side, Docker erroneously creates empty directories that match the nested structure on the host side.\r\n\r\n**Output of `docker version`:**\r\n\r\n```\r\nClient:\r\n Version:      1.12.0\r\n API version:  1.24\r\n Go version:   go1.6.3\r\n Git commit:   8eab29e\r\n Built:        Thu Jul 28 21:15:28 2016\r\n OS/Arch:      darwin/amd64\r\n\r\nServer:\r\n Version:      1.12.0\r\n API version:  1.24\r\n Go version:   go1.6.3\r\n Git commit:   8eab29e\r\n Built:        Thu Jul 28 21:15:28 2016\r\n OS/Arch:      linux/amd64\r\n```\r\n\r\n\r\n**Output of `docker info`:**\r\n\r\n```\r\nContainers: 0\r\n Running: 0\r\n Paused: 0\r\n Stopped: 0\r\nImages: 4\r\nServer Version: 1.12.0\r\nStorage Driver: aufs\r\n Root Dir: /var/lib/docker/aufs\r\n Backing Filesystem: extfs\r\n Dirs: 34\r\n Dirperm1 Supported: true\r\nLogging Driver: json-file\r\nCgroup Driver: cgroupfs\r\nPlugins:\r\n Volume: local\r\n Network: host null overlay bridge\r\nSwarm: inactive\r\nRuntimes: runc\r\nDefault Runtime: runc\r\nSecurity Options: seccomp\r\nKernel Version: 4.4.15-moby\r\nOperating System: Alpine Linux v3.4\r\nOSType: linux\r\nArchitecture: x86_64\r\nCPUs: 4\r\nTotal Memory: 1.954 GiB\r\nName: moby\r\nID: X63G:YAIL:6A3B:CAIG:RY7T:YD5J:56WM:OAJ3:MJ27:YSN4:6G5D:ZVJJ\r\nDocker Root Dir: /var/lib/docker\r\nDebug Mode (client): false\r\nDebug Mode (server): true\r\n File Descriptors: 19\r\n Goroutines: 30\r\n System Time: 2016-08-26T01:01:01.833759981Z\r\n EventsListeners: 1\r\nNo Proxy: *.local, 169.254/16\r\nUsername: jordanlewis\r\nRegistry: https://index.docker.io/v1/\r\nInsecure Registries:\r\n 127.0.0.0/8\r\n```\r\n\r\n**Additional environment details (AWS, VirtualBox, physical, etc.):**\r\nDocker for Mac, OS X El Capitan\r\n\r\n\r\n**Steps to reproduce the issue:**\r\n1. `mkdir -p /tmp/foo /tmp/bar`\r\n2. `docker run --rm --volume=\"/tmp/foo:/foo\" --volume=\"/tmp/bar:/foo/bar\" ubuntu true`\r\n3. `ls -la /tmp/foo`\r\n\r\n**Describe the results you received:**\r\nThere is an empty directory named `bar` on the host in `/tmp/foo`.\r\n\r\n**Describe the results you expected:**\r\n`/tmp/foo` and `/tmp/bar` remain empty and untouched on the host.\r\n\r\n\r\n**Additional information you deem important (e.g. issue happens only occasionally):**\r\nThis happens as well on Linux, but the erroneously created directory is also owned by root."},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/242846685","html_url":"https://github.com/docker/docker/issues/26051#issuecomment-242846685","issue_url":"https://api.github.com/repos/docker/docker/issues/26051","id":242846685,"user":{"login":"cpuguy83","id":799078,"avatar_url":"https://avatars.githubusercontent.com/u/799078?v=3","gravatar_id":"","url":"https://api.github.com/users/cpuguy83","html_url":"https://github.com/cpuguy83","followers_url":"https://api.github.com/users/cpuguy83/followers","following_url":"https://api.github.com/users/cpuguy83/following{/other_user}","gists_url":"https://api.github.com/users/cpuguy83/gists{/gist_id}","starred_url":"https://api.github.com/users/cpuguy83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpuguy83/subscriptions","organizations_url":"https://api.github.com/users/cpuguy83/orgs","repos_url":"https://api.github.com/users/cpuguy83/repos","events_url":"https://api.github.com/users/cpuguy83/events{/privacy}","received_events_url":"https://api.github.com/users/cpuguy83/received_events","type":"User","site_admin":false},"created_at":"2016-08-26T20:44:00Z","updated_at":"2016-08-26T20:44:00Z","body":"What are you expecting to have happen here?"}}
{"actor":{"display_login":"cpuguy83"}}