I\'ve recently tried running a cron job from within a linked docker container and run into an issue. My main docker container is linked to a postgres container and its port numb
The environment is set, but not available to the cron job. To fix that, you can do these two simple things
1) Save the env to a file in your ENTRYPOINT or CMD
CMD env > /tmp/.MyApp.env && /bin/MyApp
2) Then read that env into your cron command like this:
0 5 * * * . /tmp/.MyApp.env; /bin/MyApp