Skip to content

Make it easier to ignore/allow specific environment variables #92

Description

@michaelherold

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions