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.
It’s possible docker build can’t find the Dockerfile. Check the directory listing with dir and confirm there is a file named Dockerfile in the C:\Users\abc\Desktop\sample\ directory.
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.