Hi, when I run the following commands,
- docker build -t nginx-example .
- docker build -t nginx-example ./Dockerfile
I receive this following error:
“unable to prepare context: unable to evaluate symlinks in Dockerfile path: GetFileAttributesEx C:\Users\abc\Desktop\sample\Dockerfile: The system cannot find the file specified”.
I’m using windows 10.
Any help would be appreciated.
docker build can’t find the Dockerfile. Check the directory listing with
dir and confirm there is a file named
Dockerfile in the
Thank you for getting back to me. I actually figured out the problem. I had to save the Dockerfile without any extension. The system was saving it with .txt extension. When I removed the extension it worked.
I had the same issue when trying a manual build before testing my Jenkins project. My issue was that I was not in the correct folder. I was in my workspace folder when I was running my docker build command. Once I changed directories to be in the workspace/[project_name] directory then the build ran fine.
Actually, my problem was i was trying to point to wrong extension that is,
I was trying to map .txt where as I had to map to
Docker file. So that’s why I wasn’t able to map.