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
To escape any weird characters that could break your script, and according to reasoning from Mark's answer, add this line to your entrypoint.sh
:
env | sed -r "s/'/\\\'/gm" | sed -r "s/^([^=]+=)(.*)\$/\1'\2'/gm" \ > /etc/environment
This way, if you have any variable like affinity:container==My container's friend
, it will be converted to affinity:container='=My container\'s friend
, and so on.