Docker Community Forums

Share and learn in the Docker community.

[Debian BUSTER] Segmentation fault (core dumped) for RUN npm install

Hello,

I don’t know if this has been reported before but I wanted to point out that the “RUN npm install” alone doesn’t work properly in a dockerfile.

Here are the versions of the different services:

  • docker : Docker version 20.10.7, build f0df350
  • Debian :Debian 10 lastest version

Here is the content of the dockerfile :

ROM node:8.4.0-wheezy AS builder
WORKDIR /app/
#requirement & app
COPY ./application .
#install from requirement & compiler le code
RUN npm install

#Alpine leger
FROM alpine:latest
WORKDIR /app/
COPY --from=builder  /app .
#Install node & npm
RUN apk add nodejs>8
RUN apk add npm>5
#expose port
EXPOSE 5000

I do the following command to create it:
docker build -t dev_app_projet:0.0.1 .

I managed to work around the problem by adding these lines in addition to the npm install:

RUN npm install -g npm@7.17.0
RUN npm install react-dev-utils --legacy-peer-deps
RUN npm install -g nodemon

But I don’t think this is a lasting solution.

I did the test on other distributions:

  • Ubuntu 20.04 → Works with the most basic configurations
  • CentOs 7 → Works with the most basic configurations

Have you already noticed the problem on your side or it’s just me?

Regards.