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
inspired by @Kannan Kumarasamy answer:
for variable_value in $(cat /proc/1/environ | sed 's/\x00/\n/g'); do
export $variable_value
done
I can't state for sure, what process with pid1 is and that its stable during lifetime of OS. but as it is the first process to be run, inside a container i guess we can take it for granted it is a process with desired env vars set. take all of this with pich of salt unless some linux/docker docs proves this is completely ok.