JetBrains / teamcity-docker-agent

TeamCity agent docker image sources
https://hub.docker.com/r/jetbrains/teamcity-agent/
Apache License 2.0
77 stars 64 forks source link

NUGET_XMLDOC_MODE=skip has consequences and is not recommended by TeamCity documentation. #42

Open tg73 opened 5 years ago

tg73 commented 5 years ago

The Dockerfile sets NUGET_XMLDOC_MODE=skip. I can see that this would help performance. However, I can find no general TeamCity documentation that advises making this change on build agents. Therefore it would seem likely that this is not set on most users' non-Docker-based agents. And so it seems odd that it would be set on the Docker image, which, arguably, should represent the typical agent configuration that a user would have created by hand following the best practices advocated by the relevant TeamCity documentation.

In our case, we have a custom code generation tool (consumed as a NuGet package) that, among other things, mirrors documentation from base classes into overridden methods in the generated classes - and the XML documentation files are needed for this. So this setting breaks our builds.

dtretyakov commented 5 years ago

@tg73, the NUGET_XMLDOC_MODE=skip setting comes from the original docker images provided by Microsoft, e.g: https://github.com/dotnet/dotnet-docker/blob/master/2.1/sdk/nanoserver-1803/amd64/Dockerfile

If you need different setting you could easily create derived image from jetbrains/teamcity-agent or define required env.NUGET_XMLDOC_MODE environment parameter in your build configuration.

tg73 commented 5 years ago

@dtretyakov, I'm slightly confused: for example, https://github.com/JetBrains/teamcity-docker-agent/blob/master/windowsservercore/Dockerfile appears to be based on microsoft/dotnet-framework:4.7.2-sdk-windowsservercore-$TAG, which comes from https://github.com/Microsoft/dotnet-framework-docker/blob/master/4.7.2-windowsservercore-1803/sdk/Dockerfile, which is based on microsoft/dotnet-framework:4.7.2-runtime-windowsservercore-1803 which comes from https://github.com/Microsoft/dotnet-framework-docker/blob/master/4.7.2-windowsservercore-1803/runtime/Dockerfile, which is based on microsoft/windowsservercore:1803. None of those Dockerfiles introduce NUGET_XMLDOC_MODE=skip. None of those are based on microsoft/dotnet (which comes from the url you mentioned https://github.com/dotnet/dotnet-docker/blob/master/2.1/sdk/nanoserver-1803/amd64/Dockerfile), and the actual ENV directive appears to be introduced for the first time in https://github.com/JetBrains/teamcity-docker-agent/blob/master/windowsservercore/Dockerfile.

It's still not clear to me why having this setting in a general-purpose TC agent image is a good idea, notably when compared to the general TC documentation. For my own purposes, I've had to create my own Dockerfile "flattened" all the way down including the content microsoft/dotnet-framework:4.7.2-sdk Dockerfile because our builds need additional workloads from the buildtools installer, and despite my best efforts I could not successfully get the buildtools installer to add further components to the existing installation - so instead we add what we need from the very beginning. So I can of course use my desired setting. I'm raising the issue because it might be a subtle pitfall for other users.