5

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! :)

3 Answers 3

6

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

Sign up to request clarification or add additional context in comments.

1 Comment

@azure support/microsoft/visual studio team - This is still broken in latest releases. Please fix it.
1

Tray this:

copy ./path/path path

btw I did not see your file in the screenshot :)

3 Comments

thx for you comment, i try this :) BTW: i have add my Projectstructure with Docker File :P :P
can you please explain more about your written text "copy ./path/path path" -> where concret Generall Question: Do I have two dockerfiles for each frontend & backend ?!? ( I read this often )
that is a relative path to Dockerfile . normally Docker should run only one service per Container therefore you will find all the good practices refer to seperate each service to its own Container and manage them using docker-compose.
0

Keep the docker file on the solution folder level instead of inside the project.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.