Build vs Runtime environment variables

8/27/2016

I am a bit confused on when to a build environment variable vs a runtime environment variable in OpenShift Enterprise. Would someone please help me understand and provide example use cases for each?

-- MathLearner
docker
jboss
kubernetes
openshift

1 Answer

8/27/2016

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.

-- Graham Dumpleton
Source: StackOverflow