The problem is some lingering files in your bin and obj directories, which you don’t need to build your app from source. Therefore I think the best solution is to add the bin and obj directories into a .dockerignore file, which will exclude those folders from copying into your Docker context, resulting in a small performance boost. Here’s what my .dockerignore file looks like for dotnet apps:
.dockerignore
.env
.git
.gitignore
.vs
.vscode
docker-compose.yml
docker-compose.*.yml
**/bin
**/obj
bin/
obj/