1. Can't paste with formatting, sorry - I tried ..
2. Getting this error:
A step does not have the minimum resources needed to run (1024 MB). Services on the current step are consuming 7128 MB
How do I give some memory to my step 1? Couldn't find it anywhere explained. Tried to reduce from 7128 to 6000, getting the same error just with 6000 now. If anymore could point me in the right direction that would be helpful, thanks.
default: # TODO: add branches
name: ECR login script
- pip install awscli
- echo $(aws ecr get-login --no-include-email --region us-west-2) > ecr.sh
name: Build and push docker image
# TODO: should be prod ECR
- docker build --tag <image>:$BITBUCKET_COMMIT .
- export AWS_ACCESS_KEY_ID=<access key>
- sh ecr.sh
- docker push <image>:$BITBUCKET_COMMIT
Have you tried using size: 2x in your first step as you do for the second step?
Bitbucket pipelines has two configurations for memory 4GB (size: 1x which is the default) and 8GB (size: 2x) as per Configure bitbucket-pipelines.yml (size).
⚠️That will double the minutes consumed for your build.
I also recommend you to check this document to be informed of what limitations you will find in Bitbucket pipelines:
I hope that helps.
I reviewed your script again after your last message (thank you for calling my attention) and found this:
Add Docker to all build steps in your repository
options: docker: true
Note that even if you declare Docker here, it still counts as a service for Pipelines, has a limit of 1 GB memory, and can only be run with two other services in your build step. This setting is provided for legacy support, and we recommend setting it on a step level so there's no confusion about how many services you can run in your pipeline.
The options > docker > true is adding docker as a service to all steps and definitions > services > docker > memory > 7128 is configuring the docker instance to use a bigger amount of memory. I would say that to fix the issue you needed just to remove the options section and leave the docker service definition inside the second step only.