Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker | Error by creation a Docker Image in Azure DevOps with VS 2019

I am new in the Docker-World and i struggle very hard to create a Docker Image in Azure DevOps.

So First i created a Angular ASP.NET Core 2.2 Webapplication on VS 2019.

Then i committed this in Azure DevOps & configure the Pipline for manuell or automatic build process which create a docker image. After then i create a Docker file in VS2019 -> Project -> ADD Docker Support -> Linux.

Conclusion when i start my pipeline so I get this error

COPY failed: stat /var/lib/docker/tmp/docker-builder088029891/WebapplicationTestLinuxDocker/WebapplicationTestLinuxDocker.csproj: no such file or directory /usr/bin/docker failed with return code: 1

enter image description here

Projectstructure: enter image description here

My Docker File looks like: enter image description here

And my .dockerignore have this: enter image description here

I thank you in advance and I hope you can help me! :)

like image 988
Unknown Avatar asked May 06 '19 10:05

Unknown


1 Answers

the source paths are relative to the Dockerfile. So in your Dockerfile it says:

["WebapplicationTestLinuxDocker/WebapplicationTestLinuxDocker.csproj","WebapplicationTestLinuxDocker/"]

change it to:

["WebapplicationTestLinuxDocker.csproj","WebapplicationTestLinuxDocker/"]

then go down two lines and where it says:

COPY . .

change it to:

COPY . WebapplicationTestLinuxDocker/

Hope that works!

Tim

like image 150
timanderson Avatar answered Nov 15 '22 03:11

timanderson