I have also referred to another stack overflow thread ādocker-compose, failed to solve: rpc error: code = Unknown desc = failed to compute cache key: ā/app/package.jsonā not found: not foundā (sorry I could only put 2 links)
I have another repository with a docker-compose.yml that starts up a django and postgres container and works fine. Canāt share more about that because itās work related.
What I have done:
toggling buildkit on and off
turning off other network services like Synctazor on my machine
uninstall and reinstall docker, restart, update docker desktop
I didnāt take note of what the previous version was, but it must be quite some time since I last updateā¦,
However, I found a very strange workaround for the issue:
The error seems to come about when I run docker-compose from a newly clone github repository (my own repo)
However, when I made a new directory locally instead and ran docker-compose from there, it worked and I was able to get containers built, use docker bash etc.
No, but I rarely use Docker on Windows. So the error happens only when you build a specific image or could you build the same content by creating everything locally instead of cloning from the repo?
Then my guess is that your Git client on Windows changes line endings when you clone the project. Git Bash letās you turn this behaviour off when you install it. I donāt know why line endings would cause the error you had, but chaning line endings automatically can definitely cause problems.
I had a similar problem. For me changing the file encoding, to UTF-8 solved the issue. In VS Code there is the metadata in the bottom right corner. There you can go on the encoding method and change it to UTF-8 (do āSave with Encodingā and not the other one). I hope it helps someone, as it took years of my life.