0

Ours is a .NET WPF application that requires tools like MSBuild and some other custom tools to build (Total is around 10 tools that need to be installed on top of Windows OS). We use Azure Pipelines with VMs as build agents. The problem is that whenever we have to increase the number of build agents, We have to install the tools manually in each of them to make it ready to build the application.

Is it a feasible approach to run the pipeline within a container in order to overcome the above challenge ? For example, if we can build a container Image with all the tools installed, will it be possible to load this Image and then run the pipeline job inside this container ?

Or is there an alternate solutions available for this manual installation ? Thanks.

PS: Cloning of the VM of the build agents is not an option due to IT security policies.

Marck
  • 107
  • 1
  • 10

1 Answers1

1

Is it possible to use containers to build .NET WPF application in Azure pipelines?

The answer is yes, you can use container job in yaml pipeline.

On Linux and Windows agents, jobs may be run on the host or in a container. (On macOS and Red Hat Enterprise Linux 6, container jobs are not available.) Containers provide isolation from the host and allow you to pin specific versions of tools and dependencies. Host jobs require less initial setup and infrastructure to maintain.

Containers offer a lightweight abstraction over the host operating system. You can select the exact versions of operating systems, tools, and dependencies that your build requires. When you specify a container in your pipeline, the agent will first fetch and start the container. Then, each step of the job will run inside the container. You cannot have nested containers. Containers are not supported when an agent is already running inside a container.

Hugh Lin
  • 17,829
  • 2
  • 21
  • 25
  • Thanks for the response. I have a doubt about the windows container images available from Microsoft. It looks like most of them are Windows server Images. May be it's not a problem and the application will be built properly. But out of curiosity, are there actually windows 10 container images available directly to be used in the pipelines ? – Marck Apr 02 '21 at 13:44
  • Windows Server 2019 is the latest server-edition of Windows 10. All currently provided are Windows server images. – Hugh Lin Apr 06 '21 at 09:25
  • Building this application requires some tools that have to be available in the build agent. Today, the build agents are VMs and we install these tools manually in each of the agent. I believe that we can change this if we switch to containers. But how to standardize the container Images and use them in Azure pipelines ? I am looking into the Azure container registry option. Is this the right direction ? Or there are other ways to do this ? Please let me know. – Marck Apr 12 '21 at 11:37
  • Containers can be hosted on registries other than Docker Hub. To host an image on Azure Container Registry or another private container registry, add a [service connection](https://learn.microsoft.com/en-us/azure/devops/pipelines/library/service-endpoints?view=azure-devops) to the private registry. Please refer to this [part](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/container-phases?view=azure-devops#endpoints). – Hugh Lin Apr 16 '21 at 09:16