BewareMyPower commented on code in PR #288:
URL:
https://github.com/apache/pulsar-client-node/pull/288#discussion_r1073622557
##########
pkg/linux/Dockerfile_linux_glibc:
##########
@@ -17,15 +17,19 @@
# under the License.
#
-ARG NODE_VERSION
+FROM centos:7
-FROM node:${NODE_VERSION}-buster
+RUN yum update -y
+RUN yum install -y gcc gcc-c++ make python3
-RUN apt-get update -y && \
- apt-get install -y \
- curl \
- g++ \
- make \
- python3
+ARG ARCH
+WORKDIR /app
+RUN SUFFIX=$(echo ${ARCH} | sed 's/86_//') && \
+ echo $SUFFIX && \
+ curl -O -L
https://nodejs.org/download/release/v16.19.0/node-v16.19.0-linux-$SUFFIX.tar.gz
&& \
Review Comment:
> It has nothing to do with the Node.js version, right?
The pre-built Node.js binary is built with a specific C++ compiler. So there
is a GLIBCXX requirement for the `node` binary itself.
You can run the `centos:7` container first:
```bash
docker run --rm -it centos:7 /bin/bash
```
Then run:
```bash
yum update -y
curl -O -L https://nodejs.org/dist/v18.13.0/node-v18.13.0-linux-x64.tar.xz
tar xf node-v18.13.0-linux-x64.tar.xz
./node-v18.13.0-linux-x64/bin/node
```
You will see the following error:
```bash
./node-v18.13.0-linux-x64/bin/node: /lib64/libm.so.6: version `GLIBC_2.27'
not found (required by ./node-v18.13.0-linux-x64/bin/node)
./node-v18.13.0-linux-x64/bin/node: /lib64/libc.so.6: version `GLIBC_2.25'
not found (required by ./node-v18.13.0-linux-x64/bin/node)
./node-v18.13.0-linux-x64/bin/node: /lib64/libc.so.6: version `GLIBC_2.28'
not found (required by ./node-v18.13.0-linux-x64/bin/node)
./node-v18.13.0-linux-x64/bin/node: /lib64/libstdc++.so.6: version
`CXXABI_1.3.9' not found (required by ./node-v18.13.0-linux-x64/bin/node)
./node-v18.13.0-linux-x64/bin/node: /lib64/libstdc++.so.6: version
`GLIBCXX_3.4.20' not found (required by ./node-v18.13.0-linux-x64/bin/node)
./node-v18.13.0-linux-x64/bin/node: /lib64/libstdc++.so.6: version
`GLIBCXX_3.4.21' not found (required by ./node-v18.13.0-linux-x64/bin/node)
```
Though maybe we can use other ways to install Node.js 18 on CentOS 7, but it
could be much more complicated.
We only need to build the `Pulsar.node` with the NAPI of Node.js and the
compatibility of NAPI is good. So using Node.js 16 on CentOS 7 is not a problem.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]