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

Allow passing array to env-file parameter #94

Closed
michaloo opened this issue Sep 2, 2014 · 4 comments
Closed

Allow passing array to env-file parameter #94

michaloo opened this issue Sep 2, 2014 · 4 comments

Comments

@michaloo
Copy link
Contributor

michaloo commented Sep 2, 2014

Hey, thanks for the crane. It works fine and it's very helpful.

Yet I have found one case when I cannot use all Docker features.
In Docker reference there is an information about run command flags related to the environmental variables:

All three flags, -e, --env and --env-file can be repeated

While env parameter in crane is an array type, the env-file is string only, so I can't pass multiple env-files in a container definition.

I have only basic golang knowledge, but it looks that /crane/container.go file needs small changes around RunParameters.RawEnvFile variable to make it working on array of strings.

Thanks again for all the work :)

@michaelsauter
Copy link
Owner

Thanks, glad you enjoy Crane.
--env-file might have changed, I think it was just a string when I implemented it.

Now, even if your Golang knowledge is quite basic, it's really easy to get into and a pull request would be highly welcome! Should be similar to https://github.com/michaelsauter/crane/blob/c13cb961be4aeeca74c0b182481370af723093bb/crane/container.go#L137-143.

Want to give it a shot?

@bjaglin
Copy link
Collaborator

bjaglin commented Sep 3, 2014

To be backward-compatible, and for sanity, I am wondering if it should also be possible to provide a string-value env-file as the syntax allows it today (and not be forced to use a single-element array) a la https://github.com/michaelsauter/crane/blob/c13cb96/crane/container.go#L232-L243. That would need to be done consistently for all flags that can be repeated though, so I guess it could be done in a separate PR.

@michaelsauter
Copy link
Owner

Crane is still not past 1.0, so I'm OK with breaking behaviour. I always wanted to be as close to raw Docker commands/flags as possible, so I think this is best implemented as array-only as that is what the official docs suggest.

@michaelsauter
Copy link
Owner

Closed via #98.

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

3 participants