Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Container 'docker' exceeded memory limit..

Vikram Kumar
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!
October 4, 2022
i m getting this error- Container 'docker' exceeded memory limit.
when i m trying to build
My .yml file is:-
image: # Choose an image matching your project needs

clone:
depth: full # SonarCloud scanner needs the full history to assign issues properly

definitions:
caches:
sonar: ~/.sonar/cache # Caching SonarCloud artifacts will speed up your build
steps:
- step: &build-test-sonarcloud
name: Build, test and analyze on SonarCloud
caches:
- sonar
script:
- # Build your project and run
- pipe: sonarsource/sonarcloud-scan:1.4.0
- step: &check-quality-gate-sonarcloud
name: Check the Quality Gate on SonarCloud
script:
- pipe: sonarsource/sonarcloud-quality-gate:0.1.6

branches:
master:
- step: *build-test-sonarcloud
- step: *check-quality-gate-sonarcloud
pull-requests:
'**':
- step: *build-test-sonarcloud
- step: *check-quality-gate-sonarcloud

 

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 10, 2022

Hi @Vikram Kumar,

In Pipelines builds, regular steps have 4096 MB of memory in total. The build container is given 1024 MB of the total memory.

Pipes use a Docker service, which has a default memory limit of 1024 MB. If the pipe needs more memory than that, I would suggest increasing that limit, you can do that in the definitions section of your bitbucket-pipelines.yml file. E.g. if you want to increase the memory of the Docker service to 2048 MB, you can use a definition as follows:

definitions:
services:
docker:
memory: 2048

This will allocate 2048 MB of memory to the Docker service. You can also try increasing it to more, if this is not enough, up to 3072 MB (since the build container is given 1024 MB of the total memory).

If the Docker service needs more than 3072 MB, then you can increase the total memory available to a step by using size: 2x for a step. This will give the step 8 GB of memory, and then the Docker service can be configured to use up to 7128 MB.

Please keep in mind that pipelines configured with 2x will use twice the number of build minutes.

If you have any questions, please feel free to let me know.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events