-
Notifications
You must be signed in to change notification settings - Fork 1
Description
The call to bash --norc --noprofile here is a bit of half-measure that gives us worst of both worlds:
| exec bash --norc --noprofile |
Even though .bashrc and .bash_profile aren't loaded, any environment variables that were already set by them using export will still persist, so it's not really doing much to prevent "clashing with our paths". Specifically, the PATH value is persisted.
In my case, when running locally, this keeps all my variables, but removes useful things like alias ll="ls -la" and bind 'set completion-map-case on'. Most importantly, I have a custom PROMPT_COMMAND set to a local function, and while the PROMPT_COMMAND variable persists, the local function it refers to doesn't, so I get annoying errors after any command I run.
The proper way of running in a clean environment is env -i. This discards everything previously set by export. However, it comes with caveats of its own. It can't be used in bash.sh, because it will discard all the variables set by the previous links in the script chain, so it needs to be run at the very start of the entrypoint. But even that will end up discarding environment variables set by Docker Cloud, most importantly TRANSCRYPT_PASSWORD.
So in conclusion, I'd like for this line to be removed, and am seeking arguments to the contrary here.