{"action":"closed","issue":{"url":"https://api.github.com/repos/docker/docker/issues/7511","labels_url":"https://api.github.com/repos/docker/docker/issues/7511/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/7511/comments","events_url":"https://api.github.com/repos/docker/docker/issues/7511/events","html_url":"https://github.com/docker/docker/issues/7511","id":39907692,"number":7511,"title":"ADD and COPY does not work correctly with nested directory","user":{"login":"sanemat","id":75448,"avatar_url":"https://avatars.githubusercontent.com/u/75448?v=3","gravatar_id":"","url":"https://api.github.com/users/sanemat","html_url":"https://github.com/sanemat","followers_url":"https://api.github.com/users/sanemat/followers","following_url":"https://api.github.com/users/sanemat/following{/other_user}","gists_url":"https://api.github.com/users/sanemat/gists{/gist_id}","starred_url":"https://api.github.com/users/sanemat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanemat/subscriptions","organizations_url":"https://api.github.com/users/sanemat/orgs","repos_url":"https://api.github.com/users/sanemat/repos","events_url":"https://api.github.com/users/sanemat/events{/privacy}","received_events_url":"https://api.github.com/users/sanemat/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2014-08-10T13:14:02Z","updated_at":"2015-02-27T00:25:18Z","closed_at":"2015-02-27T00:25:18Z","body":"ADD nested directory does not work well.\r\n\r\nThis is reproduce step:\r\n\r\nDirectory:\r\n```\r\n.\r\n├── Dockerfile\r\n├── parent-dir\r\n│   ├── child-dir\r\n│   │   └── child.txt\r\n│   └── parent.txt\r\n└── reproduce.txt\r\n```\r\n\r\nThis is Dockerfile:\r\nhttps://github.com/sanemat/copy-example/blob/e4d6e6ea67ed9e9274830e0d23539ee6b3467f7d/Dockerfile\r\n\r\nThis is example repo https://github.com/sanemat/copy-example\r\n\r\nHow to reproduce:\r\n$ git clone https://github.com/sanemat/copy-example.git\r\n$ cd copy-example\r\n$ chmod -R go-rwx .\r\n\r\n$ ls -alR\r\n\r\n```text\r\ntotal 16\r\ndrwx------   7 sane  staff  238  8 10 21:27 .\r\ndrwxr-xr-x   5 sane  staff  170  8 10 21:16 ..\r\ndrwx------  12 sane  staff  408  8 10 21:27 .git\r\ndrwx------  10 sane  staff  340  8 10 21:27 .idea\r\n-rw-------   1 sane  staff  265  8 10 21:24 Dockerfile\r\ndrwx------   4 sane  staff  136  8 10 21:17 parent-dir\r\n-rw-------   1 sane  staff   29  8 10 21:27 reproduce.txt\r\n\r\n(snip)\r\n\r\n./parent-dir:\r\ntotal 8\r\ndrwx------  4 sane  staff  136  8 10 21:17 .\r\ndrwx------  7 sane  staff  238  8 10 21:27 ..\r\ndrwx------  3 sane  staff  102  8 10 21:18 child-dir\r\n-rw-------  1 sane  staff    7  8 10 21:17 parent.txt\r\n\r\n./parent-dir/child-dir:\r\ntotal 8\r\ndrwx------  3 sane  staff  102  8 10 21:18 .\r\ndrwx------  4 sane  staff  136  8 10 21:17 ..\r\n-rw-------  1 sane  staff    6  8 10 21:18 child.txt\r\n```\r\n\r\n$ docker build -t sanemat/copy-example .\r\n$ docker run -t -i sanemat/copy-example:latest /bin/bash\r\n\r\n% ls -alR /code/parent/\r\n\r\n```text\r\n  /code/parent/:\r\n  total 16\r\n  drwxrwxrwx 4 root root 4096 Aug 10 12:49 .\r\n  drwxrwxrwx 4 root root 4096 Aug 10 12:49 ..\r\n  drwxrwxrwx 2 root root 4096 Aug 10 12:49 child-dir\r\n  -rwxrwxrwx 1 root root    7 Aug 10 12:48 parent.txt\r\n  ls: cannot open directory /code/parent/child-dir: Permission denied\r\n```\r\n\r\n% cd /code/parent/child-dir\r\n\r\n```text\r\nbash: cd: /code/parent/child-dir: Permission denied\r\n```\r\n\r\nMy env:\r\n```text\r\n$ docker version\r\nClient version: 1.1.2\r\nClient API version: 1.13\r\nGo version (client): go1.2.1\r\nGit commit (client): d84a070\r\nServer version: 1.1.2\r\nServer API version: 1.13\r\nGo version (server): go1.2.1\r\nGit commit (server): d84a070\r\n\r\n$ docker -D info\r\nContainers: 44\r\nImages: 157\r\nStorage Driver: aufs\r\n Root Dir: /var/lib/docker/aufs\r\n Dirs: 247\r\nExecution Driver: native-0.2\r\nKernel Version: 3.13.0-24-generic\r\nDebug mode (server): false\r\nDebug mode (client): true\r\nFds: 29\r\nGoroutines: 67\r\nEventsListeners: 2\r\nInit Path: /usr/bin/docker\r\nSockets: [unix:///var/run/docker.sock]\r\nWARNING: No swap limit support\r\n\r\n$  uname -a\r\nLinux mouse.tachikoma.io 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux\r\n```"}}