I'm just building a small, single page Blazor Web Assembly page and deploying it to Azure. Sometimes I would get Pipeline failures, but on rerun they would work.
Today I'm getting a "Container 'docker' exceeded memory limit." error, I followed the troubleshooting steps and added the lines to show the memory usage that doesn't get anything near the maximum.
This happens after "Publishing to directory ...".
Logs:
Memory usage in bytes:
50667520
Swap memory usage in bytes:
0
Tue Jun 3 10:55:58 UTC 2025
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 4464 1472 ? S 10:52 0:00
root 2 0.0 0.0 4464 1860 ? S 10:52 0:00
root 3 0.0 0.0 4384 1552 ? S 10:52 0:00
root 5 0.0 0.0 4464 2152 ? S 10:52 0:00
root 26 0.0 0.0 4464 1388 ? S 10:52 0:00
root 27 0.0 0.0 20220 5752 ? S 10:52 0:00
root 45 0.0 0.0 20220 5744 ? S 10:52 0:00
root 47 0.0 0.0 20220 5744 ? S 10:52 0:00
root 54 0.0 0.4 752756 46012 ? Sl 10:52 0:00 docker container
root 599 0.0 0.0 4364 660 ? S 10:55 0:00
root 601 0.0 0.0 15584 2132 ? R 10:55 0:00
time="2025-06-03T10:55:58Z" level=error msg="error waiting for container: unexpected EOF"
I was using Microsoft's yaml for the build and deploy, for it to suddenly stop working was really weird, I was just using a very small part of the memory, even tried the 2x, but still had issues.
I went back and saw that the occasional fails I got were the same issues, so something has probably changed int the backend for it to now always happen and not some rare times. So I started trying to allocate memory directly to docker and lo and behold the issue was fixed.
Here is my final yaml, the bold part was added to fix the issue.
definitions:
services:
docker:
memory: 1024
pipelines:
branches:
main:
- step:
name: Deploy to test
deployment: test
script:
- chown -R 165536:165536 $BITBUCKET_CLONE_DIR
- pipe: microsoft/azure-static-web-apps-deploy:main
variables:
APP_LOCATION: $BITBUCKET_CLONE_DIR/TeachingTool
OUTPUT_LOCATION: wwwroot
API_TOKEN: $deployment_token
Hope it may help someone in the future.
I added the solution I found to the question.
Added this to the top of the yaml.
definitions:
services:
docker:
memory: 1024
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.