Docker image Pipeline takes only 4 mins to complete build but now after 1 hour also build is running and failed finally

Sanginatham Venkata Nagendra 0 Reputation points
2025-08-05T09:45:49.0266667+00:00

Hi Team,

Docker image build take only 4 mins to complete build, But suddenly after 1 hour also it is running and failed due to timeout. Please help on this. Attached pipelines logs. Please help us to resolve this issue.

Pipeline url: https://dev.azure.com/CAD-MGA/MGA-Administration-Platform/_build/results?buildId=1073&view=logs&j=275f1d19-1bd8-5591-b06b-07d489ea915a

Azure DevOps
{count} votes

Accepted answer
  1. Durga Reshma Malthi 9,840 Reputation points Microsoft External Staff Moderator
    2025-08-12T13:40:07.24+00:00

    Hi Sanginatham Venkata Nagendra

    Change your docker-compose.yml volume to use an environment variable with a default:

    volumes:
      - ${LOCAL_WWWROOT:-/tmp/wwwroot}:/app/wwwroot
    
    • Locally (Windows): LOCAL_WWWROOT points to c:\mga_xsc_api_qa
    • In CI (Linux): defaults to /tmp/wwwroot if LOCAL_WWWROOT is not set

    In your classic pipeline’s Docker Compose build task:

    Go to the Variables tab

    Add:

    Name: LOCAL_WWWROOT

      Value: `/tmp/wwwroot`
      
         Scope: Pipeline (not secret)
         
    

    This way, during the build on Linux agents, docker-compose uses /tmp/wwwroot instead of c:\mga_xsc_api_qa.

    In your pipeline task settings, add these environment variables to the Docker-related tasks:

    DOCKER_BUILDKIT - 1

    COMPOSE_DOCKER_CLI_BUILD - 1

    This ensures docker-compose build uses BuildKit, which is faster and more stable on Microsoft-hosted agents.

    Add timeout to prevent hanging:

    timeout 600 docker-compose build xc.xsc.api
    

    And also monitor this github for more updates - https://github.com/actions/runner-images/issues/12688

    Hope this helps!

    Please Let me know if you have any queries.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Sanginatham Venkata Nagendra 0 Reputation points
    2025-08-05T13:36:06.9+00:00

    Hi Durga Reshma Malthi,

    Please look into this asap as this is an urgent.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.