0
votes

I'm trying to run my build inside a container with azure-pipelines in Azure DevOps Server(onprem). Following the official guide https://docs.microsoft.com/en-us/azure/devops/pipelines/process/container-phases?view=azure-devops-2019

I do have a self-hosted linux agent with ubuntu18.04 installed.

My azure-pipelines.yml

pool: linux-container-build

container: ubuntu:16.04

steps:
  - script: whoami

The container initialization works fine and creates the container properly. Afterwards the checkout steps fails without much information.

Picture of pipeline: pipeline

Checkout step just does this:

##[section]Starting: Checkout ***** to s
==============================================================================
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
##[error]Collection was modified; enumeration operation may not execute.
##[section]Finishing: Checkout **** to s

1
Does your container and container host meet the requirements specified in the documentation?Daniel Mann
Yes it does, do I have to create an own image from the base image with git installed or can I put it somehow on the VM?Ravio1i

1 Answers

1
votes

I updated my task definition to:

- checkout: none

This will skip the checkout step and the 'whoami' step succeeds with proper output inside the container

It seems I need git inside my container? ..also probably all other packages..

Can I somehow add git and all required applications to the _work folder or to externels because this will get mounted in the docker volume?