Actually I've made a simple native server module for exactly this purpose - to pass some configuration or secrets via env variables to the MTA server running in docker container. There is a "getSystemEnvVariable(string variableName)" function there (no "set" counterpart as I didn't need it, but could be implemented easily). Currently I haven't published any releases of .dll / .so but the code is available on Github and you can build it yourself easily: https://github.com/4O4/mta-ml-sysutils
Generic building instruction is: run "utils/premake5 gmake && cd Build && make" on linux, and on windows run: "utils/premake5.exe vs2019" and then open Build/*.sln file in visual studio and launch build from there. After a successful build the dll / so will be in Bin/ folder. If you need help with building or want me to publish binaries built by me on github releases, just let me know.
This module also includes a second utility function "executeSystemCommand(string systemCommand, function commandFinishedCallback(exitCode, stdout, stderr))" for executing system commands asynchronously in a separate thread, although I ended up not using it very much so I don't know about its stability. Should work but no guarantees, I'm just informing you that it exists in the same module and that's why it is called "sysutils".