Hi I’m trying to create a Docker image of Strapi. I copy-pasted the Dockerfile from Custom Docker Container - Strapi Developer Docs. I’m trying to use sqlite as I’m running Strapi in a resource-constrained environment and sqlite works fine. Unfortunately, when running the Docker image I get the following error at container boot:
$ npm install @vscode/sqlite3 --save
Error relocating /opt/app/node_modules/better-sqlite3/build/Release/better_sqlite3.node: fcntl64: symbol not found
at Client_BetterSQLite3.initializeDriver (/opt/app/node_modules/knex/lib/client.js:197:13)
at new Client (/opt/app/node_modules/knex/lib/client.js:75:12)
at new Client_SQLite3 (/opt/app/node_modules/knex/lib/dialects/sqlite3/index.js:22:5)
at new Client_BetterSQLite3 (/opt/app/node_modules/knex/lib/dialects/better-sqlite3/index.js:5:1)
at knex (/opt/app/node_modules/knex/lib/knex-builder/Knex.js:12:28)
at createConnection (/opt/app/node_modules/@strapi/database/lib/connection.js:55:24)
at new Database (/opt/app/node_modules/@strapi/database/lib/index.js:32:23)
at Function.Database.init (/opt/app/node_modules/@strapi/database/lib/index.js:79:35)
at Strapi.bootstrap (/opt/app/node_modules/@strapi/strapi/lib/Strapi.js:411:30)
at Strapi.load (/opt/app/node_modules/@strapi/strapi/lib/Strapi.js:478:16)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Why? How to fix? Thanks
Edit: I tried with debian bullseye and it works, but it would be nice to have it working with Alpine since the image is much smaller.
Same issue here, I tried with different node images like node:18.14-bullseye, node:16-slim and node:16-alpine.
dm-cms@0.1.0 develop
> strapi develop
Starting the compilation for TypeScript files in /opt/app
Knex: run
$ npm install @vscode/sqlite3 --save
Error relocating /opt/app/node_modules/better-sqlite3/build/Release/better_sqlite3.node: fcntl64: symbol not found
Error: Error relocating /opt/app/node_modules/better-sqlite3/build/Release/better_sqlite3.node: fcntl64: symbol not found
at Module._extensions..node (node:internal/modules/cjs/loader:1310:18)
at Module.load (node:internal/modules/cjs/loader:1089:32)
at Module._load (node:internal/modules/cjs/loader:930:12)
at Module.require (node:internal/modules/cjs/loader:1113:19)
at require (node:internal/modules/cjs/helpers:103:18)
at bindings (/opt/app/node_modules/bindings/bindings.js:112:48)
at Object.<anonymous> (/opt/app/node_modules/better-sqlite3/lib/database.js:9:24)
at Module._compile (node:internal/modules/cjs/loader:1226:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1280:10)
at Module.load (node:internal/modules/cjs/loader:1089:32)
[2023-02-15 13:16:14.934] debug: ⛔️ Server wasn't able to start properly.
[2023-02-15 13:16:14.935] error: Knex: run
any solutions to this? I just started to play around with strapi and docker and used the Dockerfile from the documentation and I am facing the same problem.
I am building it in WSL2 and it is building fine, without errors.