Error while building docker image

Hi, i’ve been trying to build a docker image from this post : Docker Container for Raspberry Pi 4 - #4 by sing.li

But i’m having errors during buildtime :

Step 15/25 : RUN set -x && cd /app/bundle/programs/server && npm install && npm install -g node-gyp && rm -rf npm/node_modules/sharp && npm install sharp@0.22.1 && mv node_modules/sharp npm/node_modules/sharp && cd npm && npm rebuild bcrypt --build-from-source && npm cache clear --force
—> Running in 852f05c122bc

  • cd /app/bundle/programs/server
  • npm install
    npm WARN deprecated node-pre-gyp@0.15.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future

fibers@5.0.1 install /app/bundle/programs/server/node_modules/fibers
node build.js || nodejs build.js

make: Entering directory ‘/app/bundle/programs/server/node_modules/fibers/build’
CXX(target) Release/obj.target/fibers/src/fibers.o
CXX(target) Release/obj.target/fibers/src/coroutine.o
CC(target) Release/obj.target/fibers/src/libcoro/coro.o
In file included from /usr/include/ucontext.h:26:0,
from …/src/libcoro/coro.h:323,
from …/src/libcoro/coro.c:41:
/usr/include/aarch64-linux-gnu/sys/ucontext.h:51:5: error: unknown type name ‘stack_t’
stack_t uc_stack;
^~~~~~~
…/src/libcoro/coro.c: In function ‘coro_create’:
…/src/libcoro/coro.c:383:19: error: request for member ‘ss_sp’ in something not a structure or union
ctx->uc.uc_stack.ss_sp = sptr;
^
…/src/libcoro/coro.c:384:19: error: request for member ‘ss_size’ in something not a structure or union
ctx->uc.uc_stack.ss_size = (size_t)ssize;
^
…/src/libcoro/coro.c:385:19: error: request for member ‘ss_flags’ in something not a structure or union
ctx->uc.uc_stack.ss_flags = 0;
^
fibers.target.mk:125: recipe for target ‘Release/obj.target/fibers/src/libcoro/coro.o’ failed
make: *** [Release/obj.target/fibers/src/libcoro/coro.o] Error 1
make: Leaving directory ‘/app/bundle/programs/server/node_modules/fibers/build’
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:314:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Linux 5.15.32-v8+
gyp ERR! command “/usr/local/bin/node” “/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “rebuild” “–release”
gyp ERR! cwd /app/bundle/programs/server/node_modules/fibers
gyp ERR! node -v v12.22.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-gyp exited with code: 1
Please make sure you are using a supported platform and node version. If you
would like to compile fibers on this machine please make sure you have setup your
build environment–
Windows + OS X instructions here: github. com/nodejs/node-gyp
Ubuntu users please run: sudo apt-get install g++ build-essential
RHEL users please run: yum install gcc-c++ and yum groupinstall 'Development Tools'
Alpine users please run: sudo apk add python make g++
make: Entering directory ‘/app/bundle/programs/server/node_modules/fibers/build’
CXX(target) Release/obj.target/fibers/src/fibers.o
CXX(target) Release/obj.target/fibers/src/coroutine.o
CC(target) Release/obj.target/fibers/src/libcoro/coro.o
In file included from /usr/include/ucontext.h:26:0,
from …/src/libcoro/coro.h:323,
from …/src/libcoro/coro.c:41:
/usr/include/aarch64-linux-gnu/sys/ucontext.h:51:5: error: unknown type name ‘stack_t’
stack_t uc_stack;
^~~~~~~
…/src/libcoro/coro.c: In function ‘coro_create’:
…/src/libcoro/coro.c:383:19: error: request for member ‘ss_sp’ in something not a structure or union
ctx->uc.uc_stack.ss_sp = sptr;
^
…/src/libcoro/coro.c:384:19: error: request for member ‘ss_size’ in something not a structure or union
ctx->uc.uc_stack.ss_size = (size_t)ssize;
^
…/src/libcoro/coro.c:385:19: error: request for member ‘ss_flags’ in something not a structure or union
ctx->uc.uc_stack.ss_flags = 0;
^
fibers.target.mk:125: recipe for target ‘Release/obj.target/fibers/src/libcoro/coro.o’ failed
make: Leaving directory ‘/app/bundle/programs/server/node_modules/fibers/build’
make: *** [Release/obj.target/fibers/src/libcoro/coro.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:314:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Linux 5.15.32-v8+
gyp ERR! command “/usr/local/bin/node” “/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “rebuild” “–release”
gyp ERR! cwd /app/bundle/programs/server/node_modules/fibers
gyp ERR! node -v v12.22.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-gyp exited with code: 1
Please make sure you are using a supported platform and node version. If you
would like to compile fibers on this machine please make sure you have setup your
build environment–
Windows + OS X instructions here: GitHub - nodejs/node-gyp: Node.js native addon build tool
Ubuntu users please run: sudo apt-get install g++ build-essential
RHEL users please run: yum install gcc-c++ and yum groupinstall 'Development Tools'
Alpine users please run: sudo apk add python make g++
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! fibers@5.0.1 install: node build.js || nodejs build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fibers@5.0.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-04-21T16_24_02_652Z-debug.log
The command ‘/bin/sh -c set -x && cd /app/bundle/programs/server && npm install && npm install -g node-gyp && rm -rf npm/node_modules/sharp && npm install sharp@0.22.1 && mv node_modules/sharp npm/node_modules/sharp && cd npm && npm rebuild bcrypt --build-from-source && npm cache clear --force’ returned a non-zero code: 1

Any idea how to debug it ? i can see fibers seems to be the culprit or maybe a version of node js ?

My env :
Linux raspberrypi 5.15.32-v8+ #1538 SMP PREEMPT Thu Mar 31 19:40:39 BST 2022 aarch64 GNU/Linux

simonlev

Thanks

Hi! Welcome to our forums.

Please, consider also joining this channel/team: