For those who run SonarCloud in Bitbucket pipeline:
After hours of troubleshooting this issue with support from Sonar folks, I found out the only way that can make my sonarcloud-scan work in Bitbucket pipeline is increasing service container (docker) memory to 4096 as below:
definitions:
services:
docker:
memory: 4096
Keep in mind that Bitbucket Cloud allocates total 8192MB RAM to build step which is distributed to the build container and any service containers defined in the build step.
- The build container executes the scripts defined in the build step.
- The service containers run the services, if there are any.
Back to our case, we must allocate 4096MB RAM for service container (docker) in order to have sonarcloud-scan working OK. So we only have remaining 4096MB RAM for build container.
Make sure your scripts defined in the build step won’t consume too much memory, otherwise it will be killed by Bitbucket Cloud because of Out of Memory issue.
Ref: Databases and service containers | Bitbucket Cloud | Atlassian Support
Section: Service memory limits
Best regards,
Thai Nguyen