简体   繁体   中英

Docker Node not installing on alpine

I have the following Docker file directives:

RUN apk update && apk add --no-cache wget
RUN apk add --no-cache --repository http://nl.alpinelinux.org/alpine/edge/main libuv \
    && apk add --no-cache --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/main nodejs nodejs-npm \
    && echo "NodeJS Version:" "$(node -v)" \
    && echo "NPM Version:" "$(npm -v)"

I was able to build without problems since yesterday, but today I get the following error:

1.16.0-alpine: Pulling from library/nginx
Digest: sha256:270bea203d2fc3743fb9ce0193325e188b7e6233043487e3d3cf117ea4d3f337
Status: Image is up to date for nginx:1.16.0-alpine
 ---> ef04b00b089d
Step 2/22 : COPY ./default.conf /etc/nginx/conf.d/default.conf
 ---> Using cache
 ---> 5c602aac5bf7
Step 3/22 : RUN apk update && apk add --no-cache wget
 ---> Using cache
 ---> 92194be397fe
Step 4/22 : RUN apk add --no-cache --repository http://nl.alpinelinux.org/alpine/edge/main libuv     && apk add --no-cache --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/main nodejs nodejs-npm     && echo "NodeJS Version:" "$(node -v)"     && echo "NPM Version:" "$(npm -v)"
 ---> Using cache
 ---> dbe387c64016
Step 5/22 : RUN node --version
 ---> Running in 9051ea381dae
Error relocating /usr/bin/node: RSA_get0_pss_params: symbol not found
The command '/bin/sh -c node --version' returned a non-zero code: 127
Cleaning up file based variables
00:00
ERROR: Job failed: exit status 1

Any idea how to solve the RSA_get0_pss_params: symbol not found ?

Thank you

EDIT:

Whole Docker file:

FROM nginx:1.16.0-alpine

RUN apk update && apk add --no-cache wget
RUN apk add --no-cache --repository http://nl.alpinelinux.org/alpine/edge/main libuv \
    && apk add --no-cache --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/main nodejs nodejs-npm \
    && echo "NodeJS Version:" "$(node -v)" \
    && echo "NPM Version:" "$(npm -v)" 

RUN node --version
RUN apk add --update npm

Weird thing is that I was literally building yesterday around 12:00 and at 17:00, the build did not work anymore.

Solution:

FROM nginx:1.16.0-alpine
RUN apk update && apk add --no-cache wget
RUN apk add --no-cache libuv \
    && apk add --no-cache --update-cache  nodejs nodejs-npm \
    && echo "NodeJS Version:" "$(node -v)" \
    && echo "NPM Version:" "$(npm -v)"

Explain:

First check out the accepted answer in: Alpine linux in Docker container => `env: can't execute 'node': No such file or directory` .

The Alpine distro is based on a libc variant called musl-libc. The node binary you are installing is compiled against glibc, as most (all?) other standard distros use the more commonly used glibc standard library.

You install libuv and node.js from two different alpine mirrors, the reason could be a misconfigured or outdated libuv IMO.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM