Run docker/balena command from container to container or host to container


My question is maybe a bit weird but I’m stuck on some needs that I have currently.
I have one container which run perfectly with BalenaOS.
This container start an executable and may be called with arguments to returns some info.

It’s working perfectly directly from the host with the command:
balena exec -it container_name executable info
here is your info

Now I would like to store these infos into files and displayed them from a web server running into a container.

Do you think it’s possible to run this command directly from the web server container ?
Or could I create a script attached to a crontab started directly from the host ?

I may could use named volume to share info between the two containers (if it’s possible to run the command from the container) or use balena cp command to copy the retrieved data directly to the web server container (if it’s possible to run commands from host).

I’m a little bit out of solutions here. Any ideas ?
Thanks for your help!

Hello there,

How about the following scenario:

  • a two-container-setup (let’s call them info and web) with a shared volume
  • info runs a cronjob inside the container and writes the files into the shared volume
  • web displays the files

if definitely need to supply the information from outside the info container, i would suggest networking (e.g. http)

would that work for your project?

1 Like

Hi @JuanFRidano,

Thanks for this idea, I will try and let you know :slight_smile: