Fix:unable to prepare context: unable to evaluate symlinks in Dockerfile path

Sometimes when the command below is run :

docker build -t thebuildimage .

Notice the dot “.” at the end of the command (triggers the sending of the build context to docker daemon).

You will end up getting an error which looks like :

unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /somepath/Dockerfile: no such file or directory

It might be that the Dockerfile (It must be named Dockerfile by the way) describing the build, may not exist in the same directory as that from which the build command is invoked.

According to Docker, the path (dot ”.” in the command above) indicates the location of the files which are related to the “context” of the build on the Docker daemon.

Read: How to run and manage a Docker container on Linux Ubuntu/Debian

From the official Docker documentation, one can read :

As stated above, Dockerfile may not be in the context since if the command reads :

docker build ctxtdir

The Dockerfile has to be defined at ctxtdir/Dockerfile.


If you like the content, we would appreciate your support by buying us a coffee. Thank you so much for your visit and support.

 

Marianne elanotta

As a graduate in communication technologies, Marianne likes to share the latest technological advances in various fields. She likes to program in Java OO and Javascript and prefers to work on Open source operating systems. She likes to play chess and computer games in her spare time along with her 2 kids.

Leave a Reply