node-red / node-red-docker

Repository for all things Node-RED and Docker related
Apache License 2.0
469 stars 382 forks source link

TensorFlow nodes can't be installed due to Alpine image incompatibilty #378

Closed bonastreyair closed 10 months ago

bonastreyair commented 1 year ago

What are the steps to reproduce?

Installing node-red-contrib-teachable-machine (which has a dependency on @tensorflow/tfjs-node) as an excuse for installing a node that depends on tensorflow and needs a shared library ld-linux-x86-64.so.2.

What happens?

Checking the logs when starting node-red after installing the dependency you can find the following error: [node-red-contrib-teachable-machine/teachable machine] Error: Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /usr/src/node-red/node_modules/@tensorflow/tfjs-node/lib/napi-v8/../../deps/lib/libtensorflow.so.2)

Found some reference for an Alpine image that could be useful to solve the issue. I've given a try but had no success. If you get an error similar to error loading shared library ld-linux-x86-64.so.2, it may be that you have dependencies relying on libc ā€“ you can try to fix this by adding RUN apk add --no-cache libc6-compat or RUN ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2 to your Dockerfile. https://hub.docker.com/r/mhart/alpine-node/

What do you expect to happen?

I expect to run the official node-red image based on Alpine and be able to load nodes depending on TensorFlow.js, and that the libraries can be lodaded properly.

Please tell us about your environment:

knolleary commented 1 year ago

With 3.1 we will be publishing Debian based images as well. You can try out the beta build now - see https://github.com/node-red/node-red-docker/issues/340#issuecomment-1457098540

bonastreyair commented 10 months ago

It actually works! šŸ˜ŽšŸ‘Œ waiting for final v3.1 release then šŸ¤“