How Do You Troubleshoot the Error “unable to prepare context…no such file or directory”?

Problem scenario
You run "docker-compose build" and you get this:

1 error occurred:
* unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /home/jane/dockercompose/webapp/Dockerfile: no such file or directory

What should you do?

Solution
Look at your docker-compose.yml file. Look at the "build" stanza. What directory is it referring to? Is a Dockerfile file in that directory? Does that directory exist?

Leave a comment

Your email address will not be published. Required fields are marked *