Build vs Runtime environment variables Build vs Runtime environment variables kubernetes kubernetes

Build vs Runtime environment variables


An environment variable that might only be needed at build time is one such as to setup use of a proxy so that when building, external package repositories can be accessed, allowing dependencies to be pulled down. At runtime you probably wouldn't need that and since it may have account/password information in it, you wouldn't want to leave it defined as someone breaking into your application would find it and that may be valuable to them.

An environment variable that would only be set for the deployment is where a database used by the application can be found. This wouldn't generally be available at build time since the database may not have even been started at that point.