As far as I can tell, the only way to ignore an environment variable within dip is to add it to the DIP_EARLY_ENV environment variable. This is a reasonable heuristic for what to ignore, but it means that there is an order-dependence to your shell configuration.
What I found is that since I use chruby, which modifies the GEM_HOME and GEM_PATH environment variables, my dip-run containers were not picking up the bundle in my Docker volume and were thus not working.
The reason for that is that my eval "$(dip console)" was being run prior to chruby initializing.
It would be really nice if dip had the ability to allowlist/denylist environment variables to use within the containers. Something like:
environment:
allowed:
- BUNDLE_GITHUB__COM
- RAILS_MASTER_KEY
or
environment:
denied:
- GEM_HOME
- GEM_PATH
I'd be happy to take a crack at an approach if you want.
Aside
I'm not really sure what the current behavior is meant for since docker-compose already handles the environment variables that I need within my project. Why do you pass all environment variables in, instead of relying on docker-compose to manage the environment for you?
As far as I can tell, the only way to ignore an environment variable within dip is to add it to the
DIP_EARLY_ENVenvironment variable. This is a reasonable heuristic for what to ignore, but it means that there is an order-dependence to your shell configuration.What I found is that since I use chruby, which modifies the
GEM_HOMEandGEM_PATHenvironment variables, mydip-run containers were not picking up the bundle in my Docker volume and were thus not working.The reason for that is that my
eval "$(dip console)"was being run prior to chruby initializing.It would be really nice if
diphad the ability to allowlist/denylist environment variables to use within the containers. Something like:or
I'd be happy to take a crack at an approach if you want.
Aside
I'm not really sure what the current behavior is meant for since
docker-composealready handles the environment variables that I need within my project. Why do you pass all environment variables in, instead of relying ondocker-composeto manage the environment for you?