Docker: Stderr:fatal error: runtime: out of memory on AWS Elasticbeanstalk

0

Each time I am trying to build and deploy my React Project on AWS Elastic Beanstalk using Docker, I am getting this error:

Stderr:fatal error: runtime: out of memory

The project is the basic react project and nothing more, serving it via nginx. What might be the reason of this error? And how do I resolve it. Please note, I have emptied my S3 bucket and have restarted the appServer too, to try and resolve any unnecessary memory or cache use. And I am able to successfully build and run this file locally. The logs are as follows:

Step 1/9 : FROM node:alpine as builder
 ---> eb56d56623e5
Step 2/9 : WORKDIR '/app'
 ---> Using cache
 ---> 41d7415dae07
Step 3/9 : COPY package.json .
 ---> Using cache
 ---> 95877ba9972c
Step 4/9 : RUN npm install
 ---> Using cache
 ---> c366758de80f
Step 5/9 : COPY . .
 ---> 5697eace7031
Step 6/9 : RUN npm run build
 ---> Running in 52cc1a3e6ac0

> react-project-frontend@0.1.0 build
> react-scripts --openssl-legacy-provider build

Creating an optimized production build...

2022/03/03 13:14:45.346275 [WARN] failed to execute command: docker build -t aws_beanstalk/staging-app /var/app/staging/, retrying...
2022/03/03 13:14:45.425369 [INFO] Running command /bin/sh -c docker build -t aws_beanstalk/staging-app /var/app/staging/
2022/03/03 13:14:47.001398 [ERROR] An error occurred during execution of command [app-deploy] - [Docker Specific Build Application]. Stop running the command. Error: failed to build docker image: Command /bin/sh -c docker build -t aws_beanstalk/staging-app /var/app/staging/ failed with error exit status 2. Stderr:fatal error: runtime: out of memory
질문됨 2년 전746회 조회
2개 답변
0

Does node:alpine have npm installed by default? Maybe you need to install npm before running your npm install command?

답변함 2년 전
  • Yes. Node alpine has npm installed by default. Also, my docker file is successfully built on my local system.

0

Hello From Step2 to Step 4 is using cache try to clear them and re-run

답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인