Node-RED in a docker container doesn't seem to be able to execute some programs with the exec node

your docker-node-red is indeed running independently from the OS, hence it cannot execute anything that is outside of this container's reach. While you can copy binaries to a persistent folder which docker-node-red has access to, this does not guarantee all dependencies are covered to run the OS binary in your docker-node-red-OS - now or after any update of either OS or container.

There is, however, a solution:

  1. pi is the user I have on my OS. 10.10.1.100 is the ip of my raspberry running everything.
  2. ssh access is via ssh-key, hence you need to generate a key and save it once at the beginning. This can be done by accessing your docker container with docker container exec -it nodered /bin/bash. Then run ssh-keygen -f /data/ssh/id_nr -t rsa -b 4096 and copy your certificate from your docker container to your OS via f.e. ssh-copy-id -i /data/ssh/id_nr iq@10.10.1.100
  3. Finally refer to it, when you access it, like in my example with '-i /data/ssh/id_nr'
1 Like