"npm install" taking forever when building docker image

I am building an image for a frontend application.
The base image is node:12.2.0
The instruction, RUN npm run build takes forever (40 min)


Is there any way to improve this?

1 Like

Is your build server slow or the network connection?

For security reasons I would not use node 12:

The 12.x release line now moves into ā€œActive LTSā€ and will remain so until October 2020. After that time, it will move into ā€œMaintenanceā€ until end of life in April 2022

Did you find a solution to your problem? I have the same issue. npm ci takes 1000+ seconds (Linux)
Iā€™m using Node 18

What is the CPU architetcure of your Ubuntu? Do you need to emulate a different platform?