Azure Pipeline to build docker images fails using same docker file in Visual Studio

后端 未结 5 1578
执笔经年
执笔经年 2021-02-19 09:43

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

5条回答
  •  没有蜡笔的小新
    2021-02-19 10:14

    [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/"]
    

提交回复
热议问题