cant buid docker image
###############################################################
[node1] (local) [email protected] ~
$ git clone https://github.com/PleasureTools/joyBox.git
Cloning into 'joyBox'...
remote: Enumerating objects: 1074, done.
remote: Counting objects: 100% (102/102), done.
remote: Compressing objects: 100% (87/87), done.
remote: Total 1074 (delta 63), reused 19 (delta 15), pack-reused 972
Receiving objects: 100% (1074/1074), 1.14 MiB | 8.97 MiB/s, done.
Resolving deltas: 100% (570/570), done.
[node1] (local) [email protected] ~
$ cd joyBox/
[node1] (local) [email protected] ~/joyBox
$ docker build -t joybox .
Sending build context to Docker daemon 3.171MB
Step 1/33 : FROM node:current-alpine as deps
current-alpine: Pulling from library/node
ca7dd9ec2225: Pull complete
bfebca31f755: Pull complete
cc0056ab0c41: Pull complete
6e25476b6324: Pull complete
Digest: sha256:80844b6643f239c87fceae51e6540eeb054fc7114d979703770ec75250dcd03b
Status: Downloaded newer image for node:current-alpine
---> 9b78801b4058
Step 2/33 : WORKDIR /app
---> Running in 57bea409fc8c
Removing intermediate container 57bea409fc8c
---> 8a3697b3e528
Step 3/33 : RUN apk add python3 g++ make
---> Running in b207705dad9b
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/APKINDEX.tar.gz
(1/24) Upgrading musl (1.2.3-r1 -> 1.2.3-r2)
(2/24) Installing binutils (2.38-r3)
(3/24) Installing libgomp (11.2.1_git20220219-r2)
(4/24) Installing libatomic (11.2.1_git20220219-r2)
(5/24) Installing gmp (6.2.1-r2)
(6/24) Installing isl22 (0.22-r0)
(7/24) Installing mpfr4 (4.1.0-r0)
(8/24) Installing mpc1 (1.2.1-r0)
(9/24) Installing gcc (11.2.1_git20220219-r2)
(10/24) Installing musl-dev (1.2.3-r2)
(11/24) Installing libc-dev (0.7.2-r3)
(12/24) Installing g++ (11.2.1_git20220219-r2)
(13/24) Installing make (4.3-r0)
(14/24) Installing libbz2 (1.0.8-r1)
(15/24) Installing expat (2.5.0-r0)
(16/24) Installing libffi (3.4.2-r1)
(17/24) Installing gdbm (1.23-r0)
(18/24) Installing xz-libs (5.2.5-r1)
(19/24) Installing mpdecimal (2.5.1-r1)
(20/24) Installing ncurses-terminfo-base (6.3_p20220521-r0)
(21/24) Installing ncurses-libs (6.3_p20220521-r0)
(22/24) Installing readline (8.1.2-r0)
(23/24) Installing sqlite-libs (3.38.5-r0)
(24/24) Installing python3 (3.10.8-r0)
Executing busybox-1.35.0-r17.trigger
OK: 229 MiB in 39 packages
Removing intermediate container b207705dad9b
---> 9f4ea988c459
Step 4/33 : COPY package.json .
---> 33a65318c420
Step 5/33 : COPY package-lock.json .
---> 4c4484f193a4
Step 6/33 : RUN npm i && mv ./node_modules/@types/jsonstream ./node_modules/@types/JSONStream
---> Running in 789bad5faa0c
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: [email protected]
npm WARN Found: [email protected]
npm WARN node_modules/typescript
npm WARN dev typescript@"^4.8.4" from the root project
npm WARN 7 more (tsutils, tsutils, @vue/cli-plugin-typescript, ts-loader, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer typescript@"^2.1.0 || ^3.0.0" from [email protected]
npm WARN node_modules/@vue/cli-plugin-typescript/node_modules/fork-ts-checker-webpack-plugin
npm WARN fork-ts-checker-webpack-plugin@"^0.5.2" from @vue/[email protected]
npm WARN node_modules/@vue/cli-plugin-typescript
npm WARN
npm WARN Conflicting peer dependency: [email protected]
npm WARN node_modules/typescript
npm WARN peer typescript@"^2.1.0 || ^3.0.0" from [email protected]
npm WARN node_modules/@vue/cli-plugin-typescript/node_modules/fork-ts-checker-webpack-plugin
npm WARN fork-ts-checker-webpack-plugin@"^0.5.2" from @vue/[email protected]
npm WARN node_modules/@vue/cli-plugin-typescript
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Fixed a prototype pollution security issue in 4.1.0, please upgrade to ^4.1.1 or ^5.0.1.
npm WARN deprecated [email protected]: This loader has been deprecated. Please use eslint-webpack-plugin
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: Moved to 'npm install @sideway/address'
npm WARN deprecated [email protected]: 3.x is no longer supported
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated [email protected]: This version of 'buffer' is out-of-date. You must update to v4.9.2 or newer
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated [email protected]: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated @hapi/[email protected]: Switch to 'npm install joi'
npm WARN deprecated [email protected]: Version no longer supported. Upgrade to @latest
npm notice
npm notice New major version of npm available! 8.19.3 -> 9.1.3
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.1.3>
npm notice Run `npm install -g [email protected]` to update!
npm notice
npm ERR! code 1
npm ERR! path /app/node_modules/better-sqlite3
npm ERR! command failed
npm ERR! command sh -c -- prebuild-install || npm run build-release
npm ERR! > [email protected] build-release
npm ERR! > node-gyp rebuild --release
npm ERR!
npm ERR! make: Entering directory '/app/node_modules/better-sqlite3/build'
npm ERR! TOUCH b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
npm ERR! ACTION deps_sqlite3_gyp_locate_sqlite3_target_extract_sqlite3 b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
npm ERR! TOUCH Release/obj.target/deps/locate_sqlite3.stamp
npm ERR! CC(target) Release/obj.target/sqlite3/gen/sqlite3/sqlite3.o
npm ERR! AR(target) Release/obj.target/deps/sqlite3.a
npm ERR! COPY Release/sqlite3.a
npm ERR! CXX(target) Release/obj.target/better_sqlite3/src/better_sqlite3.o
npm ERR! rm b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
npm ERR! make: Leaving directory '/app/node_modules/better-sqlite3/build'
npm ERR! prebuild-install WARN install No prebuilt binaries found (target=19.2.0 runtime=node arch=x64 libc=musl platform=linux)
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp info find Python using Python version 3.10.8 found at "/usr/bin/python3"
npm ERR! gyp http GET https://unofficial-builds.nodejs.org/download/release/v19.2.0/node-v19.2.0-headers.tar.gz
npm ERR! gyp http 200 https://unofficial-builds.nodejs.org/download/release/v19.2.0/node-v19.2.0-headers.tar.gz
npm ERR! gyp http GET https://unofficial-builds.nodejs.org/download/release/v19.2.0/SHASUMS256.txt
npm ERR! gyp http 200 https://unofficial-builds.nodejs.org/download/release/v19.2.0/SHASUMS256.txt
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/app/node_modules/better-sqlite3/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/root/.cache/node-gyp/19.2.0/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/19.2.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/19.2.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/app/node_modules/better-sqlite3',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ./src/better_sqlite3.lzz:11,
npm ERR! from ../src/better_sqlite3.cpp:4:
npm ERR! /root/.cache/node-gyp/19.2.0/include/node/node.h:1013:7: warning: cast between incompatible function types from 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Context>)' to 'node::addon_context_register_func' {aka 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Context>, void*)'} [-Wcast-function-type]
npm ERR! 1013 | (node::addon_context_register_func) (regfunc), \
npm ERR! | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! /root/.cache/node-gyp/19.2.0/include/node/node.h:1031:3: note: in expansion of macro 'NODE_MODULE_CONTEXT_AWARE_X'
npm ERR! 1031 | NODE_MODULE_CONTEXT_AWARE_X(modname, regfunc, NULL, 0)
npm ERR! | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! /root/.cache/node-gyp/19.2.0/include/node/node.h:1062:3: note: in expansion of macro 'NODE_MODULE_CONTEXT_AWARE'
npm ERR! 1062 | NODE_MODULE_CONTEXT_AWARE(NODE_GYP_MODULE_NAME, \
npm ERR! | ^~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ./src/better_sqlite3.lzz:67:1: note: in expansion of macro 'NODE_MODULE_INIT'
npm ERR! ./src/util/macros.lzz: In function 'void SetPrototypeGetter(v8::Isolate*, v8::Local<v8::External>, v8::Local<v8::FunctionTemplate>, const char*, v8::AccessorGetterCallback)':
npm ERR! ./src/util/macros.lzz:157:21: error: 'v8::AccessorSignature' has not been declared
npm ERR! ./src/util/binder.lzz: In static member function 'static bool Binder::IsPlainObject(v8::Isolate*, v8::Local<v8::Object>)':
npm ERR! ./src/util/binder.lzz:37:51: error: 'class v8::Object' has no member named 'CreationContext'; did you mean 'GetCreationContext'?
npm ERR! ./src/util/data.lzz: In function 'v8::Local<v8::Value> Data::GetValueJS(v8::Isolate*, sqlite3_stmt*, int, bool)':
npm ERR! ./src/util/data.lzz:72:92: warning: this statement may fall through [-Wimplicit-fallthrough=]
npm ERR! ./src/util/data.lzz:72:197: note: here
npm ERR! ./src/util/data.lzz: In function 'v8::Local<v8::Value> Data::GetValueJS(v8::Isolate*, sqlite3_value*, bool)':
npm ERR! ./src/util/data.lzz:76:81: warning: this statement may fall through [-Wimplicit-fallthrough=]
npm ERR! ./src/util/data.lzz:76:175: note: here
npm ERR! make: *** [better_sqlite3.target.mk:125: Release/obj.target/better_sqlite3/src/better_sqlite3.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:201:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:293:12)
npm ERR! gyp ERR! System Linux 4.4.0-210-generic
npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
npm ERR! gyp ERR! cwd /app/node_modules/better-sqlite3
npm ERR! gyp ERR! node -v v19.2.0
npm ERR! gyp ERR! node-gyp -v v9.1.0
npm ERR! gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-12-03T02_28_40_254Z-debug-0.log
The command '/bin/sh -c npm i && mv ./node_modules/@types/jsonstream ./node_modules/@types/JSONStream' returned a non-zero code: 1
[node1] (local) [email protected] ~/joyBox
Since the last commit a build should work (tried again on Debian Bullseye with Docker Package from Docker).
Did you build the container with the old state of the repo in the past on the same system? If so try --no-cache.
Best Regards
Since the last commit a build should work (tried again on Debian Bullseye with Docker Package from Docker).
Did you build the container with the old state of the repo in the past on the same system? If so try
--no-cache.Best Regards
I tried on 'pwd' Mac m1 Synology,all have the same issues
Since the last commit a build should work (tried again on Debian Bullseye with Docker Package from Docker). Did you build the container with the old state of the repo in the past on the same system? If so try
--no-cache. Best RegardsI tried on 'pwd' Mac m1 Synology,all have the same issues
As far as I know the stuff is generally not tested on ARM Hardware. I don't know how the Docker Suite opperates on M1 Mac's so it could be ARM or Silicon (x86 emulation).
Is the Synology a x86 based box? I think they have like QNAP x86 and ARM boxes. If it's ARM this could explain the problem. Aspecially the smaller SOHO boxes are often ARM chips.
Best Regards
Since the last commit a build should work (tried again on Debian Bullseye with Docker Package from Docker). Did you build the container with the old state of the repo in the past on the same system? If so try
--no-cache. Best RegardsI tried on 'pwd' Mac m1 Synology,all have the same issues
As far as I know the stuff is generally not tested on ARM Hardware. I don't know how the Docker Suite opperates on M1 Mac's so it could be ARM or Silicon (x86 emulation).
Is the Synology a x86 based box? I think they have like QNAP x86 and ARM boxes. If it's ARM this could explain the problem. Aspecially the smaller SOHO boxes are often ARM chips.
Best Regards
thanks reply, my synology is x86,have you tried to build it on "play with docker"?
The build I did yesterday was on Debian Bullseye x86_64 based box. Docker is the from docker-ce package 5:20.10.21~3-0~debian-bullseye
I'm actually running a new one. The Repo state is from yesterday (3.12.2022). But I getting within seconds far above step 6 (by using no cache). Build command is like this docker build --no-cache -t joybox:04122022 .
Will give a feedback in a few minutes whether it completes. But I think so.
The build I did yesterday was on Debian Bullseye x86_64 based box. Docker is the from docker-ce package
5:20.10.21~3-0~debian-bullseyeI'm actually running a new one. The Repo state is from yesterday (3.12.2022). But I getting within seconds far above step 6 (by using no cache). Build command is like this
docker build --no-cache -t joybox:04122022 .Will give a feedback in a few minutes whether it completes. But I think so.
the latest commit is 21 days ago.i just git clone and build any code need be changed?
No nothing need to be changed.
So on Debian Bullseye AMD64 the build succeeds.
In Docker Desktop the build of SQLite in fact fails also on AMD64 Mac (iMac Late 2019).
No nothing need to be changed.
So on Debian Bullseye AMD64 the build succeeds.
In Docker Desktop the build of SQLite in fact fails also on AMD64 Mac (iMac Late 2019).
thanks I will try to build on Debian
I scrolled through the stuff and I have a thesis why this fails.
When the better-sqlite stuff get's installed it seems to be necessary to get a new version of node. Which seems to be downlaodes from this project: Unofficial Node Builds
It seems that the mainline builds have no SQLite lib linked or statically compiled in. For this NPM seems to detect and/or decide the architecture for the build to download. So in Docker desktop it detects tthe following and fails to find a prebuild:
#11 131.2 npm ERR! prebuild-install WARN install No prebuilt binaries found (target=19.2.0 runtime=node arch=x64 libc=musl platform=linux)
This seems to lead to a try of rebuilding Node and/or the extension which fails. I think here the C Library is the biggest issue. The little Linux in Docer Desktop seems to use musl not libc6. This of course could lead to uncontrolled build runs which fail.
I don't know how the Synology Linux Base is build but I think it's deffinitly possible that they also use on of the more tiny C libraries for their stuff.
All just a thesis.
I investigated a bit on this and eventually found a temporary solution.
- The problem comes from better-sqlite. They use prebuild-install and node-gyp to bring there stuff and Node.js together. Prebuilds in the terminology of prebuild and it's family is "a binary of a node addon/extension"
- I could reproduce the fail you have on Debian. Relevant is that the container wasn't repulled on my side. So it had a different version. After a repull the build error occures also on Debian. That makes sense because normally the inside Container view shouldn't be a different one. prebuild-install for some reason doesn't find a prebuild and so builds the extension from source. This simply fails. It seems that this is related to the version. Eventually it's to nwe. Keep in mind that the Prebuild Project says that musl lib c builds are not mainline stuff. Check the unofficial builds repo and the prebuild staple and node gyp. So it's likely that such things can happen. Alpine is musl based as far as I know. So also the Node.js builds for x86_64-musl are more or less experimental. So it's not a question that the extension prebuilds are likely to behave also more like experimental stuff.
- The only fix I actually can provide is that I will give below. You can use Node 18 which is an active LTS release check Wikipedia
This is the fix:
git clone https://github.com/PleasureTools/joyBox.git
cd ./joayBox/
cp Dockerfile Dockerfile.18
nano Dockerfile.18
Here change:
FROM node:current-alpine as deps
To this:
FROM node:18-alpine as deps
Then run this:
docker build -t joybox:04122022 --no-cache -f Dockerfile.18 .
This should produce a full working build on a x86_64 box. For Apple M1 I can't tell. Tested on Debian and Docker Desktop (x86_64 iMac Late 2019) both have working builds.
Your Synology should work.
Hope this helps.
Best Regards
Better SQLite just provides prebuilds for LTS versions. Check the project README. So the Dockerfile should use node:18-alpine in general.