Im trying to build a simple react based docker image in the bitbucket pipelines. Here is snippet of the yaml file:
image: python:3.10
definitions:
- step: &BuildPush
name: Build
size: 2x
services:
- docker
script:
- pip install --upgrade pip && pip install docker-compose
- export DOCKER_BUILDKIT=1
- cd frontend && docker build -t espace.jfrog.io/mcs/mcs-react:latest .
The same `docker build` command works in my local laptop. But it seems to hang (and eventually fail) when running on pipelines, during the `npm run build` step within the Dockerfile, due to some memory error. However, when running locally, I can see it doesn't use too much memory, and i even ran the pipeline with "2x" size. Here is the error after about 10 min of runtime:
<span>#13 677.5 The build failed because the process exited too early.</span>
<span>#13 677.5 This probably means the system ran out of memory or someone called</span><span>#13 677.5 `kill -9` on the process.</span><span>#13 ERROR: process "/bin/sh -c npm run build" did not complete successfully: exit code: 1</span><span>> [builder 7/7] RUN npm run build:</span><span>process "/bin/sh -c npm run build" did not complete successfully: exit code: 1</span>
Any idea what is causing this?