Unable to prepare context: unable to evaluate symlinks in Dockerfile in Asp.net Core

Dung Do Tien Mar 05 2022 285

Hi Guys, I have a project with Asp.Net Core 3.1. And I deployed it on Docker in Ubuntu 20.04. When I build docker with the command below:

 docker build -t cms:latest -f ELK.CMS/Dockerfile .

But I got an exception unable to prepare context: unable to evaluate symlinks in Dockerfile: no such file or directory.

 Unable to prepare context: unable to evaluate symlinks in Dockerfile 
path: lstat /root/chromenotification/ELK.CMS/ELK.CMS: no such file or directory

You can see /root/chromenotification/ELK.CMS/ELK.CMS, it contains cms project and I pull it from GitLab.

How can I fix it?

Have 1 answer(s) found.
  • G

    Gulam Mar 05 2022

    Your error is no such file or directory, I think something in Dockerfile was not found. 

    And you are building docker in a project folder. You can try back to the folder contain .sln project and retry build docker. 

    * Solution: type cd .. and try to run again command docker build.

    It's really worked for me.

Leave An Answer
* NOTE: You need Login before leave an answer

* Type maximum 2000 characters.

* All comments have to wait approved before display.

* Please polite comment and respect questions and answers of others.

Popular Tips

X Close