1

I want to build a node js dockerfile. npm install doesn't do anything after printing this:

Sending build context to Docker daemon   14.5MB
Step 1/7 : FROM node:lts-alpine3.13
 ---> 186a89db3aeb
Step 2/7 : EXPOSE 3000
 ---> Using cache
 ---> 353c5796d929
Step 3/7 : RUN mkdir -p /usr/src/app
 ---> Using cache
 ---> 2515a1ce4ac9
Step 4/7 : WORKDIR /usr/src/app
 ---> Using cache
 ---> 47926cacc786
Step 5/7 : COPY package*.json /usr/src/app/
 ---> Using cache
 ---> c79428f26810
Step 6/7 : RUN npm install
 ---> Running in b3d3d97650b5

> sharp@0.26.3 install /usr/src/app/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.10.0/libvips-8.10.0-linuxmusl-x64.tar.br

I've been waiting for hours. But it hasn't downloaded https://github.com/lovell/sharp-libvips/releases/download/v8.10.0/libvips-8.10.0-linuxmusl-x64.tar.br. (which is only 7.1 MB!)

What can I do?

Thanks in advance.

UPDATE

I can download the file manually using an node:lts-alpine3.13 image without any problem:

docker run -ti --rm --entrypoint /bin/sh node:lts-alpine3.13
# apk add --no-cache wget
# wget https://github.com/lovell/sharp-libvips/releases/download/v8.10.0/libvips-8.10.0-linuxmusl-x64.tar.br
HsnVahedi
  • 1,271
  • 3
  • 13
  • 34
  • 1
    There can be many different problems, starting from the network down to the image. You need to troubleshoot further. Start by entering in the container with `docker run -ti --rm --entrypoint /bin/sh node:lts-alpine3.13` and check if you can download the file manually – jordanvrtanoski Feb 26 '21 at 15:11
  • @jordanvrtanoski Thanks I did it and I could simply download the file after installing "wget". (apk add --no-cache wget). So what's the problem? – HsnVahedi Feb 26 '21 at 15:29
  • I still can not say what is the problem. Recently I had similar issues with `git` that turned out to be the SSL security problem with `libcurl-gnutls`, but I don't know if this is same here. Node-js is using `libcurl`, so first, check with older versions of alpine/nodejs and also check some of the ideas in this [post](https://stackoverflow.com/questions/16873973/npm-install-hangs) – jordanvrtanoski Feb 26 '21 at 15:41

0 Answers0