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:
#13 677.5 The build failed because the process exited too early.
#13 677.5 This probably means the system ran out of memory or someone called
#13 677.5 `kill -9` on the process.
#13 677.5
#13 ERROR: process "/bin/sh -c npm run build" did not complete successfully: exit code: 1
------
> [builder 7/7] RUN npm run build:
------
process "/bin/sh -c npm run build" did not complete successfully: exit code: 1
Any idea what is causing this?
G'day, @Prithvi Sathiya
I suggest adding the following docker service definition to give more memory to the docker service container. Using 2x only without explicitly increasing the docker container memory will not work as the default given is only 1 GB.
definitions: services: docker: memory: 2147
<Rest of your YAML>
We have documentation that touches explicitly on the docker memory limit that I highly suggest you check out at:
Regards,
Syahrul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.