0

In my project we are using Azure DevOps in which we have a pipeline which

  • pulls code from code repository
  • downloads Ubuntu container
  • installs Maven
  • downloads all the dependencies
  • then tries to build code

With this approach, every time we commit code in the repository, new container gets downloaded and Maven dependencies are downloaded as well.

Downloading dependencies itself is taking 10+ minutes which is kind of frustrating.

Is there any way in which we can cut down this build time? We have couple of virtual machines in Azure, is it possible to tell Azure DevOps pipeline to use these virtual machines to build the code instead of using containers?

I am sorry if this question is too broad/generic but I am new to DevOps and Azure in general so I don't know specific terms from DevOps world.

Thanks, Chandra

1 Answer 1

1

You can use a custom build container image for your pipeline with Maven and all of your other dependencies. You will need to:

  1. Create a Dockerfile that installs Maven and all other dependencies that you have
  2. Build the image and upload it to a custom Azure Container Registry
  3. Modify your YAML pipeline file to reference the new build image

Sample:

resources:
   containers:
     - container: build_container
       image: demoxyz.azurecr.io/pipeline-build-image:latest
       endpoint: AzureCR
       options: '-v /usr/bin/docker:/usr/bin/docker -v /var/run/docker.sock:/var/run/docker.sock'

Here is an article that discusses the topic.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.