Execute *.sh Script outside Container? possible?

Hey Folks

I have a NodeRED Container and dealing with OCR. Therefore I need to execute a .sh Script OUTSIDE from this docker container, because i want access to all of the moduls which are installed on ubuntu.

In General: Can i execute a script outside a container? installing all the modules in the node-red container wasn’t sucessfull and I think this is not the best way to do.

Thanks for your help

It doesn’t make sense to run a container just for breaking out and running a script on the host, but you can run an API service on the host and send a request to it from the container.

By “breaking out” I mean you could run a privileged container, disable pid namespace and attach to all of the namespaces of PID 1 and execute a script there. It is much better to use an API and let the API service execute the script on the host.

Are those NodeRED modules? Actually that would be the best way if you could install everything in a Docker image. But I don’t use NodeRED and I don’t really know anything about it so I could be wrong, although one of the reasons we are using containers is that we can have a portable image with all the modules and libraries and we can create and remove containers any time without installing anything on the host which would require installing dependencies that can break something.

1 Like

Thanks for your reply. You are right and this gives me an Ahaaa Moment - of course it doesn’t make sense to “break out” of the container regarding portable and the whole architecture setup!

I’m going to set up an API!

Thanks again for your time!