Pass nuget settings to other runners than dotnet (e.g. docker build)

When building with dotnet, we can create nuget feed credentials build feature and it will be used for downloading packages during dotnet restore.

But what if there is some other tool running dotnet? Visual Stuido has a feature that automatically generates (though it usually has to be fixed up a bit) a multi-stage Dockerfile for your project that restores the project in one stage, then builds in in next and then installs it to the production one. So `dotnet restore` and `dotnet build` run from inside the Dockerfile.

Is there a way to propagate the nuget feed credential build feature to other runner then dotnet?

1
1 comment

Hi!

It should be possible to use it with other runners, but I don't know if it works with all of them. As an example, if you use a build step such as the NuGet Installer, it will try to download NuGet packages from the feed specified in the NuGet Feed Credentials build feature. Then your agent will automatically use the credentials specified in the feature.

Did you try to use it with other specific runners, and if so, did you run into any issues? 

It also might be interesting to you to check TeamCity Container Wrapper, which allows running a build step inside a specified docker image:

https://www.jetbrains.com/help/teamcity/cloud/2023.11/container-wrapper.html

 

0

Please sign in to leave a comment.