{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/6521","labels_url":"https://api.github.com/repos/docker/docker/issues/6521/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/6521/comments","events_url":"https://api.github.com/repos/docker/docker/issues/6521/events","html_url":"https://github.com/docker/docker/issues/6521","id":36044923,"number":6521,"title":"Docker build is not running cause the permission of one folder not used in the build process ","user":{"login":"wiliamsouza","id":215986,"avatar_url":"https://avatars.githubusercontent.com/u/215986?v=3","gravatar_id":"","url":"https://api.github.com/users/wiliamsouza","html_url":"https://github.com/wiliamsouza","followers_url":"https://api.github.com/users/wiliamsouza/followers","following_url":"https://api.github.com/users/wiliamsouza/following{/other_user}","gists_url":"https://api.github.com/users/wiliamsouza/gists{/gist_id}","starred_url":"https://api.github.com/users/wiliamsouza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wiliamsouza/subscriptions","organizations_url":"https://api.github.com/users/wiliamsouza/orgs","repos_url":"https://api.github.com/users/wiliamsouza/repos","events_url":"https://api.github.com/users/wiliamsouza/events{/privacy}","received_events_url":"https://api.github.com/users/wiliamsouza/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2014-06-19T02:27:36Z","updated_at":"2015-02-10T14:05:10Z","closed_at":null,"body":"This image has a `startup` script that create mysql initial database and change permissions of files in `/var/lib/mysql` that directory is mounted from local directory `volumes/lib` the files are owned by `mysql` user that is create inside the container when you try to build the image and this files exists `docker build` fail.\r\n\r\nHow to reproduce\r\n\r\n1) clone the repo:\r\n```\r\ngit clone https://github.com/wiliamsouza/docker-mysql.git\r\n```\r\n2) build the image:\r\n```\r\ndocker build -t wiliamsouza/mysql .\r\n```\r\n3) run the container:\r\n```\r\ndocker run --name mysql -p 3306:3306 -d \\\r\n-v `pwd`/volumes/log:/var/log/mysql \\\r\n-v `pwd`/volumes/lib:/var/lib/mysql \\\r\n-v `pwd`/volumes/conf.d:/etc/mysql/conf.d \\\r\n-e MYSQL_ROOT_PASSWORD=rootpass \\\r\n-e MYSQL_DATABASE=mydb \\\r\n-e MYSQL_USER=myuser \\\r\n-e MYSQL_PASSWORD=mypass -t wiliamsouza/mysql\r\n```\r\n\r\n4) Change the Dockerfile to use ubuntu version to 14.04.\r\n\r\n5)  try build the image using other tag\r\n```\r\ndocker build -t wiliamsouza/mysql:1404 .\r\n```\r\n\r\nObtained result:\r\n```\r\n2014/06/18 23:12:04 Error checking context is accessible: 'no permission to read from 'volumes/lib/ib_logfile0''. Please check permissions and try again.\r\n```\r\n\r\nExpected result:\r\nBuild the image with different tag\r\n\r\nAfter the first run the state of tree and permissions is:\r\n```\r\n$ tree\r\n.\r\n├── clean.sh\r\n├── Dockerfile\r\n├── fig.yml\r\n├── README.md\r\n├── repos.sh\r\n├── startup\r\n├── supervisord.conf\r\n└── volumes\r\n    ├── conf.d\r\n    │   └── bind.cnf\r\n    ├── lib\r\n    │   ├── ibdata1\r\n    │   ├── ib_logfile0\r\n    │   ├── ib_logfile1\r\n    │   ├── mydb [error opening dir]\r\n    │   ├── mysql [error opening dir]\r\n    │   └── performance_schema [error opening dir]\r\n    └── log\r\n        └── error.log\r\n\r\n7 directories, 12 files\r\n\r\n$ ls -l volumes/lib/\r\ntotal 28684\r\n-rw-rw---- 1 syslog netdev 18874368 Jun 18 23:11 ibdata1\r\n-rw-rw---- 1 syslog netdev  5242880 Jun 18 23:11 ib_logfile0\r\n-rw-rw---- 1 syslog netdev  5242880 Jun 18 23:11 ib_logfile1\r\ndrwx------ 2 syslog netdev     4096 Jun 18 23:11 mydb\r\ndrwx------ 2 syslog root       4096 Jun 18 23:11 mysql\r\ndrwx------ 2 syslog netdev     4096 Jun 18 23:11 performance_schema\r\n```\r\n\r\n$ uname -a\r\n```\r\nLinux envy 3.13.0-29-generic #53-Ubuntu SMP Wed Jun 4 21:00:20 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux\r\n```\r\n\r\n$ docker version\r\n```\r\nClient version: 1.0.0\r\nClient API version: 1.12\r\nGo version (client): go1.2.1\r\nGit commit (client): 63fe64c\r\nServer version: 1.0.0\r\nServer API version: 1.12\r\nGo version (server): go1.2.1\r\nGit commit (server): 63fe64c\r\n```\r\n\r\n$ docker info\r\n```\r\nContainers: 3\r\nImages: 47\r\nStorage Driver: aufs\r\n Root Dir: /var/lib/docker/aufs\r\n Dirs: 53\r\nExecution Driver: native-0.2\r\nKernel Version: 3.13.0-29-generic\r\nWARNING: No swap limit support\r\n```"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/73703731","html_url":"https://github.com/docker/docker/issues/6521#issuecomment-73703731","issue_url":"https://api.github.com/repos/docker/docker/issues/6521","id":73703731,"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":"2015-02-10T14:05:10Z","updated_at":"2015-02-10T14:05:10Z","body":"Is this really a bug? I'd image if you did `sudo docker build` it would work just fine.\r\nIf your user in the container is writing stuff to a dir with perms that make it so your user where the client is run doesn't have access it seems to be expected behavior."}}