Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment variables, docker-compose integration? #9

Open
kohlerm opened this issue Apr 20, 2016 · 2 comments
Open

Environment variables, docker-compose integration? #9

kohlerm opened this issue Apr 20, 2016 · 2 comments

Comments

@kohlerm
Copy link

kohlerm commented Apr 20, 2016

Hi,
Great project!
I have been hacking on something similar some time ago (not available for the public).
One requirement I have is being able to to pass environment variables into the docker container, which is the recommended way to configure containers at runtime. E.g for me nut test fails because wget does not know about my http proxy. E.g. passing my HTTP_PROXY env variable to the docker container would help.
A generic solution to this would be to support docker-compose files. There is a library for golang
https://github.com/docker/libcompose for docker-compose.

The rationale would be that a lot of people already might have docker-compose files at least for services (start a Jboss server). docker-compose also has support for reusing stopped containers (only works if your run the exact same command).

@matthieudelaro
Copy link
Owner

Hi @kohlerm

Yes, we need env variables. The plan is to be able to specify them in the nut.yml, along with any other parameters that we can give to docker cli (directories, ports binding, env variables, etc).

In addition to this I like the idea of supporting compose files, especially since you mention the lib in Go and the ease of use for compose users. And the two options could work together by introducing a new kind of base environment in nut.yml:

based_on:
  compose:
    path: path/to/docker-compose.yml
    service: reddis  # I don't think it would make sense to inherite configuration from several services, right?

@matthieudelaro
Copy link
Owner

I added support for environment variables in commit 6700eca673d4a631608e58a3fe437d7842e555c8.
You can find an example of the syntax in examples.

Does it allow you to use the proxy?

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

No branches or pull requests

2 participants