Posts

Showing posts with the label Docker agent

Azure DevOps Docker DotNet Build Agent

This blog post presents how to create and run a DotNet Azure DevOps pipeline as a Docker container. However, there is a slight problem when running VSTest on this container, and the remedy to this problem is explained in this post. Sources related to this container are located in this GitHub repo . Steps to create, run and test Docker DotNet build agent  Clone this GitHub repo to the local machine. Open a Powershell window and navigate to the folder where the cloned project is located. Execute “ docker build -t dockeragent:latest . ” to create the Docker image. Execute “ docker run -e AZP_URL=<Azure DevOps instance> -e AZP_TOKEN=<PAT token> -e AZP_AGENT_NAME=mydockeragent -e AZP_POOL=<(optional) pool to register the agent under> dockeragent:latest " to run a container based on the created image. Please remember to replace the placeholders with the information related to your Azure DevOps project. In a web browser navigate to the Agents tab under the Agent pool y...

Running a Docker build agent on Azure Kubernetes Service (AKS)

Image
In this blog post, we are going to run the Docker build agent we created in a previous blog post and run it on Azure Kubernetes Service (AKS).  Prerequisites   1. An Azure DevOps project to connect the AKS hosted build agent. We are going to use the PartsUnlimited project we created in an  earlier post  which meets these criteria. 2. Have Docker installed on your local machine with the ability to create and run Windows containers (Refer to the troubleshooting section on this post for instructions on how to switch). 3. Have Azure CLI installed on your machine. Steps First, we are going to tag the previously created docker build agent with a new tag more suitable for version control, and run it to test operation. 1. To create the docker agent we need to create a new folder and download the following Dockerfile file . ( Link to the normal view ) and start.ps1 file . ( Link to the normal view ) files into a local folder as follows. 2. Then open a Powershell w...

Building Azure DevOps pipelines with a Docker agent

Image
 In this post, we are going to create a Docker image to use as a build agent to Azure DevOps pipelines. The process followed in this blog post is similar to the process followed in the post where we used an Azure VM as the build agent . The difference is, instead of using an Azure VM as an agent, we are going to run a Docker container as an agent on localhost. Prerequisites   1. An Azure DevOps project to build using the Docker agent. We are going to use the PartsUnlimited project we created in an  earlier post  which meets these criteria. 2. Have Docker installed on your local machine with the ability to create and run Windows containers (Refer to the troubleshooting section on how to switch). Steps There are a lot of steps involved in creating a Docker agent and running the build pipeline on it. So I will add subtopics between steps to group steps related to a specific subtask. 1. Creating the Agent pool and generating personal access for the new build agent 1.1. N...