Is this Dockerfile in your home directory? In case there are files which the current user can't access you will run into this error.
Commented Aug 24, 2014 at 8:45 I am stuck with same error message. Using mingcw on Windows. Commented May 22, 2015 at 11:07 Why does docker look at other files in the directory? What reason does it have for this? Commented Jan 17, 2016 at 15:37I faced the same issue while working with boot2docker on Windows 7. However I was able to build it successfully after moving dockerfile outside home directory.
answered May 25, 2015 at 7:58 2,104 1 1 gold badge 18 18 silver badges 23 23 bronze badges Same error, but on a Windows OS. This answer fixed it Commented Feb 18, 2016 at 21:47 Same error on ubuntu 14.04, moving to non-home directory worked Commented Sep 6, 2016 at 14:15 The same strategy works for the same issue in mac as well. Commented Apr 24, 2017 at 21:09In my case this issue is occurred because when we call docker build all files searched in working directory and as docker does not run with administrator privilege cannot access to some files and this error generated.
$ cd /c $ mkdir sep $ cd sep $ touch Dockerfile # vi Dockerfile # docker build -t fahsep/debian