TriggerMail / rules_pyz

Bazel Python rules that package everything in an executable zip
Apache License 2.0
29 stars 19 forks source link

Only a small set of env. vars are passed on to the main script. #48

Closed gfl-chris closed 5 years ago

gfl-chris commented 5 years ago

We rely on a environment variable 'ENV' (i.e. 'production' or 'staging') for our web services to know what environment they're running in. When dumping the OS environment variables in my pyz2_image's binary, it only prints four variables: PATH, HOSTNAME, HOME, and PYTHONPATH.

It looks like the remaining environment variables are stripped from the execution environment. Is there a way to allow certain env. variables to be carried along? Or is this a bug?

gfl-chris commented 5 years ago

When using docker run to run an image, environment variables are mostly stripped out. If you need to inject environment variable values, we need to create a run target for each set of config values.