Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

ERROR: Container build returned 125

neilscales
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 30, 2025

I'm trying to build a Net8 AOT project with trimming.  I get "ERROR: Container build returned 125" at the end.  I presume this is some sort of out of memory message because if I disable trimming it builds.  I have the build size set to 8x (also tried 16x) but it always fails.I don't get this error building locally (32GB dev machine).  Is there a trick for running AOT trimming on Bitbucket?

 

 

Build log:

dotnet lambda package -c Release Lambda.zip

Amazon Lambda Tools for .NET Core applications (5.12.4)
Found /etc/os-release
Found /etc/os-release
Executing publish command
Starting container for native AOT build using build image: public.ecr.aws/sam/build-dotnet8:latest-x86_64.
... invoking 'docker run --name tempLambdaBuildContainer-848be619-a29e-4e11-9b8e-2e660c9f3c7e --rm --volume "/opt/atlassian/pipelines/agent/build":/tmp/source/ -i public.ecr.aws/sam/build-dotnet8:latest-x86_64 dotnet publish "/tmp/source/src/Lambda" --output "/tmp/source/src/Lambda/bin/Release/net8.0/publish" --configuration "Release" --framework "net8.0" /p:GenerateRuntimeConfigurationFiles=true --runtime linux-x64 --self-contained True /p:StripSymbols=true' from directory /opt/atlassian/pipelines/agent/build
... docker run: Unable to find image 'public.ecr.aws/sam/build-dotnet8:latest-x86_64' locally
... docker run: latest-x86_64: Pulling from sam/build-dotnet8
... docker run: 2537a3b71252: Pulling fs layer
... lots of docker pull messages
... docker run: ed830c6c8e6a: Pull complete
... docker run: Digest: sha256:bda53ca8bccf837ebf9073ed984db1b57ba02be4f31cf75ba6f87bff7a43052c
... docker run: Status: Downloaded newer image for public.ecr.aws/sam/build-dotnet8:latest-x86_64
... docker run: Determining projects to restore...
... docker run: Restored /tmp/source/src/Lambda/Lambda.csproj (in 5.14 sec).
... docker run: Lambda -> /tmp/source/src/Lambda/bin/Release/net8.0/linux-x64/Lambda.dll
... docker run: Generating native code
... docker run:
... lots of trim warnings
... docker run: time="2025-05-29T15:50:33Z" level=error msg="error waiting for container: unexpected EOF"
ERROR: Container build returned 125

1 answer

0 votes
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 1, 2025

Hi neilscales,

May I know if you are executing this on self-hosted runners or just on regular Atlassian infrastructure?

I'd suggest the following FAQ troubleshooting article as a first step:

Cheers!

- Ben (Bitbucket Cloud Support)

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events