During Docker build in Gitlab job pipeline the process is freezed on
- sharp@0.28.3 install /app/node_modules/sharp
- (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
- sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.10.6/libvips-8.10.6-linux-x64.tar.br
After 1 hour buil is killed by timeout.
Dockerfile:
FROM node:14.17.0
WORKDIR /app
ARG NODE_ENV=dev
ENV NODE_ENV $NODE_ENV
ENV PORT 3005
COPY ["package.json", "tsconfig.json", "./"]
RUN npm install --unsafe-perm
COPY ./src ./src
COPY ./views ./views
RUN npm run build
EXPOSE $PORT
CMD ["npm","start"]
I tryed build docker on my Windows environment whitout problem.
That looks like lovell/sharp issue 2611
Workaround:
In case you cannot upgrade, change this line in
node_modules/sharp/binding.gyp:'-std=c++0x',To:
'-std=c++14',And run npm rebuild
Actual solution: upgrade.
I force the resolution on
package.jsonto use the new version of Sharp and I could install and run, however my node-sass blow due the Node 16.
I remove the sharp resolution and downgrade the image in the gitlab CI Docker to node:14Everything works fine now, so it seems was an issue with Node instead of Sharp.
The OP Pid confirms in the comments having resolved the issue by updating the host OS Ubuntu (20.04).
But that lead to lovell/sharp issue 2817, which in turn requires GitLab support.