1

Recently, I started working with Docker to run my Node project and wanted to add the Oracle instant client driver. As far as I know Oracle instant client driver is compiled against glibc library while my Docker images which is Alpine based includes musl library.

So I needed a way to include the glibc libraries and I stumbled upon docker-glibc-builder which packages the glibc libraries as a compressed package.

After including the glibc library into the container I started noticing the following errors when ever my Node project would call the Oracle the instant driver.

Error: Error relocating /opt/oracle/drivers/instantclient/libclntsh.so.11.1: getcontext: symbol not found
    at Error (native)
    at Object.Module._extensions..node (module.js:568:18)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (node_modules/oracledb/lib/oracledb.js:32:19)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (node_modules/oracledb/index.js:1:80)

Anyone run into such an error ?

4

1 回答 1

4

所以我需要一种方法来包含 glibc 库

请注意,您不能libc在单个进程中混合和匹配两个单独的库。您必须选择其中之一。此外,您必须针对将在运行时使用的同一库进行构建(仅在 Docker 映像中包含运行时包是不够的)。

根据 musl wiki,musl 不提供getcontext。您得到的错误与您继续使用 musl 而不是 glibc 一致。

于 2016-07-01T08:47:14.247 回答