I'm trying to add functionality to an existing docker-entrypoint script, the creators of the image decided environment variables would have the form key.subkey=value. I didn't know it was an invalid naming scheme until I've tried to set and parse my own variables. Since their naming scheme is invalid, they are reading them like this:
while IFS='=' read -r var key
do
# parse
done < <(env)
What I want to do is mount a modified entrypoint that unsets my own "invalid" env variables after use, otherwise my variables will get caught by their regex pattern and will cause the script to exit. Because they pass in the captured variables to the binary as options.
Is there anyway I can unset invalid variables that's been forcibly set using docker's environment variables functionality ? Because when I try to do:
unset -v foo.foo-bar.setting-to-update
I get:
bash: unset: `foo.foo-bar.setting-to-update': not a valid identifier
Thank you
export
shell command does? I'll add a hint:env -i bash
runs a fresh copy of bash in an empty environment.