每次我尝试连接到 Oracle DB 时都会收到此错误:
DPI-1047: Cannot locate a 64-bit Oracle Client library: "Error loading shared library libnsl.so.1: N
o such file or directory (needed by /lib/libclntsh.so)". See https://oracle.github.io/node-oracledb/INSTALL.html for help
Node-oracledb installation instructions: https://oracle.github.io/node-oracledb/INSTALL.html
You must have 64-bit Oracle client libraries in LD_LIBRARY_PATH, or configured with ldconfig.
If you do not have Oracle Database on this computer, then install the Instant Client Basic or Basic Light package from
http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
在我的 Dockerfile 中,我有以下代码:
ENV LD_LIBRARY_PATH=/lib
RUN curl -OL https://download.oracle.com/otn_software/linux/instantclient/19600/instantclient-basic-linux.x64-19.6.0.0.0dbru.zip && \
unzip instantclient-basic-linux.x64-19.6.0.0.0dbru.zip && \
cp -r instantclient_19_6/* /lib && \
rm -rf instantclient-basic-linux.x64-19.6.0.0.0dbru.zip && \
apk add --no-cache libaio && \
apk add --no-cache libaio libnsl libc6-compat && \
cd /lib && \
# Linking ld-linux-x86-64.so.2 to the lib/ location (Update accordingly)
ln -s /lib64/* /lib && \
ln -s libnsl.so.2 /usr/lib/libnsl.so.1 && \
ln -s libc.so.6 /usr/lib/libresolv.so.2
我究竟做错了什么?我也尝试过ln -s libc.so /usr/lib/libresolv.so.2
看来,找不到 libresolv.so.2
在 Dockerfile 中添加 gcompat:
RUN apk add gcompat
gcompat 包括 libresolv.so.2。查看链接
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)