Hi,
Idea. Be able to execute commands inside containers from RouterOS scripts/console. It could look like
:local result [/container exec 0 command="some_Linux_command --with arguments"]; :put $result
Use cases. Change config files and/or run additional binaries dynamically based on RouterOS events. Query container binaries, collect statuses. Debug containers without entering interactive console.
Existing workarounds. It’s possible to stop the container, change its entrypoint to run a custom command, start it again. It will execute the command and stop, then change its entrypoint back and start again. Finally, parse RouterOS logs to get the command output.
Such a workaround doesn’t fit if you would like to query the existing container processes (e.g. you have a ZeroTier container in CHR and would like to get a list of its peers with zerotier-cli).
Linux solution. See nsenter command.
What do you think about it?
Regards,