I have a React app that has multiple steps in the pipeline. Two of these steps seem to require conflicting memory limits for the docker service.
The two steps are:
- Static analysis with Sonarcloud
- Building via react-scripts build
The first step runs static analysis using Sonarcloud:
- step: &StaticAnalysis name: Static Analysis with SonarCloud
image: atlassian/default-image:2 #quickest image
size: 2x
script:
- pipe: sonarsource/sonarcloud-scan:1.2.1
- pipe: sonarsource/sonarcloud-quality-gate:0.1.4
This step will fail with an error "Container 'docker' exceeded memory limit." without increasing the docker service memory limit as such:
definitions:
services:
docker:
memory: 2048
However, when I increase the docker memory limit, the next step fails with the error: "Container 'Build' exceeded memory limit.". If I remove the above service definition, the build step passes fine.
I tried putting:
services:
docker:
memory: 2048
Under the steps, but this produced a yaml error from the pipeline saying that services is expected to be a list, not a map.
Is there a way for me to configure the docker memory limit based off the step?