I\'m trying to create a deployment pipeline to deploy my image to Kubernetes cluster. The first step in this process is to create an image based on the docker file. The docker
[error]COPY failed: stat/var/lib/docker/tmp/docker-builder158012929/DockerTest/DockerTest.csproj: no such file or directory
According to this error message, the error occurred on the line of your dockerfile: COPY ["DockerTest/DockerTest.csproj", "DockerTest/"]
.
First, please confirm that you did not use .dockerignore
file to exclude this file: DockerTest/DockerTest.csproj
, which must exists in the directory where you run your build from.
If it does not ignored by .dockerignore
file, then you need to consider about your dockerfile location level.
DockerTest.csproj
file should not put at the lower source file path level. You need to change the source of the context, move it at a higher level. So modify your dockerfile manually as :
COPY ["DockerTest.csproj", "DockerTest/"]