Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Defining environment variables #208

Closed
capoferro opened this issue Jun 19, 2014 · 5 comments
Closed

Defining environment variables #208

capoferro opened this issue Jun 19, 2014 · 5 comments

Comments

@capoferro
Copy link

I suspect this is me being new to working with gear, but I cannot figure out how to provide environment variables to my containers.

What is the correct way of setting environment variables, equivalent to -e from docker run?

@sajmoon
Copy link

sajmoon commented Jun 19, 2014

On the github page for geard they have an example:

"$ gear install ccoleman/envtest localhost/env-test1 --env-file=deployment/fixtures/simple.env

Loading environment into a running container is dependent on the "docker run --env-file" option in Docker master from 0.9.x after April 1st. You must start the daemon with "gear daemon --has-env-file" in order to use the option - this option will be made the default after 0.9.1 lands and the minimal requirements will be updated."

One example of an .env file can be found in the repo itself:
https://github.com/openshift/geard/blob/master/deployment/fixtures/simple.env

@smarterclayton
Copy link
Contributor

You can also set env via

$ gear install openshift/busybox-http-app localhost/myservice A=B B=C C=D

@capoferro
Copy link
Author

Thanks for the notes. I had tried --env-file but I must have been doing something wrong. Is there a way to define environment variables via the json definition of containers?

@capoferro
Copy link
Author

[edit] I'm an idiot, I missed the note about starting the gear daemon with --has-env-file

Thanks all!

@smarterclayton
Copy link
Contributor

bluepojo the default has now been changed to be "true" (but it's not in the Fedora packages yet I don't think) since Docker landed their env file support.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants