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
You can run the following command
. <(xargs -0 bash -c 'printf "export %q\n" "$@"' -- < /proc/1/environ)
This is exceptionally works when you have the environment variables with special characters like ' " =
'
"
=