Team,
I created a CI/CD pipeline for one of our micro service but it failed with the following error.
node:14-alpine image is used to create docker image. Moreover docker build took more than 30 minutes prior failing (it's too slow)
Error Message
Container 'docker' exceeded memory limit
Pipeline Code
pipelines:
branches:
Development:
- step:
name: Pre-requisite step
script:
- echo "No pre-requisites found"
- step:
name: Create docker image
script:
- echo "Creating docker image"
- docker build -t microservice:$BITBUCKET_BUILD_NUMBER .
services:
- docker
caches:
- docker
I referred the following URL
to fix the issue but unfortunately issue is not resolved
I also tried by setting the following to increase the memory limit for docker service
definitions:
services:
docker:
memory: 2048
and tried setting size: 2x in the pipeline but all failed with the same error
Kindly let me know had I missed anything
Thanks
Sathish Kumar
The error message means that the Docker container used by your pipeline has run out of memory. This can happen if your pipeline is trying to build a large image or if your pipeline is running on a machine with limited resources.
You may need to further optimize your pipeline or use a machine with more resources.
Please try:
Hi @Oday Rafeh
Thank you for replying to my question.
As suggested. I would try to convert it to multi-stage docker image. However, I've got another question.
"Use a machine with more memory or CPU resources to run your pipeline. You can try increasing the size of the machine or using a different machine type with more resources."
How to select / use a different machine on BitBucket Cloud ? Kindly let us know if it possible to use a different machine as we are a subscribed user.
Regards
Sathish Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @sureshbabu_a ,
To use a different machine for your Bitbucket Cloud pipeline, you can use the "size" parameter in your pipeline configuration. This parameter allows you to specify the size of the machine that your pipeline runs on.
For example, you can use "size: 2x" to specify that your pipeline should run on a machine with double the resources of the default machine.
Here's an example pipeline configuration that sets the machine size to 2x:
pipelines:
default:
- step:
name: Build and test
size: 2x
script:
- echo "Building and testing..."
Note that not all sizes may be available in all regions, and larger sizes may come with additional costs. You can check the Bitbucket Cloud pricing page for more information.
I hope this helps! Let me know if you have any further questions.
Best regards,
Oday Rafeh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.