Home > Back-end >  Azure Devops MS Hosted Agent Pool Agent machine
Azure Devops MS Hosted Agent Pool Agent machine

Time:08-06

I read this article. Assign specific agent on Azure DevOps YAML Pipelines

When i run my CI pipeline a Dockerfile is executed as well. This Dockerfile pulls a base image and then build my code image.

When we investigated if time to build Dockerfile is X min, 90% of X min is actually spent in downloading base image itself.

We are using MS hosted agents currently.

Does MS agents recycle themself each time its called by any user?. I mean if i try to call MS hosted same agent machine again will it still HOLD base image from last pipeline call?

CodePudding user response:

In the MS hosted agents, each time you run a pipeline, you get a fresh virtual machine. The virtual machine is discarded after one job finished, which means any change that a job makes to the virtual machine file system, such as pulls a base image, will be unavailable to the next job. So if you want to minimize the time which you spent for pulling the image, use a Self-hosted agent. You can even use your local PC as a Self-hosted agent.

  • Related