TeamCity server not detecting MSBuild installation from docker build agent
Hello JetBrains
I try to setup a docker build agent with MSBuild 15.0 installed but TeamCity refuses to detect MSBuild despite the location of my folders are exactly where they should.
On physical machines, I installed MSBuild 15 through Visual Studio 2017 Build Tools installer, which created the folder C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\bin, where MSBuild.exe is located. When I copy that folder to a docker image based on your docker image "jetbrains/teamcity-agent:2019.1.2-windowsservercore-1809", my agent requirements tell me "Unmet requirements: MSBuildTools12.0_x86_Path exists". What am I doing wrong?
Please sign in to leave a comment.
Hi Ruben,
just to copy one folder isn't enough.
Please check this instruction by Microsoft.
Hi Nadia
Thanks for your reply. I read the article, but how do I merge the output of that dockerfile with the docker image jetbrains/teamcity-agent?
Hi Ruben,
you can create your own images, based on the official `jetbrains\teamcity-agent' image.
Hi Nadia
I don't think you understood. In the article, the dockerfile starts with the base image "mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019" while my dockerfile starts with the base image "jetbrains/teamcity-agent". It is not possible for Docker to merge two base images = as if it were two glasses of liquids poored into one glass.
Hence my question, how do I merge the output image, which is the result of building the dockerfile MS presented, with the contents of the image "jetbrains/teamcity-agent" when both images are different?
Hi Ruben,
As far as I understand with a multi-stage Docker build, you can use different images to install some tools and then copy them to the resulting image. Have you tried it? Here is the example for `jetbrains/teamcity-agent` Dockerfile.
Hi Nadia
Yes, I did. That is how I ended up here. I used the "jetbrains/teamcity-agent" image as base and copied all sort of files and such from MSBuild folders. However, in the example you sent me the guy did it the other way around. Which is much easier too imho, not on option for me sadly. But I can cherry-pick instructions from that file to mine and see if I can make it work that way.
Hello Ruben,
Have you managed to build a teamcity build agent image with MSBuild 15?
Also, have you tried to cherry-pick instructions for downloading and installing vs_buildtools.exe into Dockerfile based on jetbrains/teamcity-agent image?
Thanks,