Do custom build in docker
Looking to optimize our build flow a bit and hopefully reduce maintenance time for build agents. We do a lot of .NET/.NET Core and Angular and have a series of build agents with bare minimum dependencies, which are all updated via Octopus Deploy. However not all builds 'fit' in these builds and often require different version of SDK and tooling.
Is it possible to let the individual builds specify their own docker image and actually run the build within these, on a set of existing windows build agents E.g.
Project A: Image with Visual Studio Build tools 2017, .NET Framework 4.6.2
Project B: Image with Visual Studio Build Tools 2019, .NET Core SDK 3.1
I've been reading up on TeamCity and docker support for build agents, but the tutorials always have static build agents running in docker. Ideally I would want 30 build agents running windows with docker support, and have my builds specify their own docker image + dependencies. Possible?
Please sign in to leave a comment.
Hi Jasper,
it seems like what you would be interested is in something like our docker wrapper https://www.jetbrains.com/help/teamcity/docker-wrapper.html . It's available for the .NET CLI build runner type, so you could try that, at the very least for project B. If you cannot adapt Project A to be built via the .net CLI commands, you would need to wrap the building commands in a command line or powershell script that can in turn be wrapped with the docker wrapper.
Another possibility would be to use cloud profiles for docker where you can spawn docker agents dynamically. There isn't a bundled way to do it currently, you could use a third party plugin such as https://plugins.jetbrains.com/plugin/9306-docker-cloud, or in more advanced cases, use our Kubernetes setup: https://github.com/JetBrains/teamcity-kubernetes-plugin, which we are considering to bundle for the next major release.
Would any of that work for you?