Skip to content
This repository has been archived by the owner on Oct 22, 2023. It is now read-only.

More concise passing of environment variables #68

Closed
ineffyble opened this issue Feb 25, 2019 · 6 comments
Closed

More concise passing of environment variables #68

ineffyble opened this issue Feb 25, 2019 · 6 comments

Comments

@ineffyble
Copy link
Contributor

Our batect.yml currently has many many lines under environment blocks that look like:

environment:
    HOSTNAME: $HOSTNAME

When you want to pass a host variable through to the container as the same name and value, a more concise format could be helpful. This is something Docker-Compose and Buildkite do well.

E.g.:

environment:
    - HOSTNAME
@charleskorn
Copy link
Collaborator

Makes sense to me, thanks for the suggestion @ineffyble!

@nesl247
Copy link

nesl247 commented Apr 25, 2019

Should I open another issue to have the same support for build_args?

@charleskorn
Copy link
Collaborator

charleskorn commented Apr 26, 2019

@nesl247 are you asking for the ability to use environment variables in build arg values? If so, yes, please open a separate issue.

@nesl247
Copy link

nesl247 commented Apr 26, 2019

I'm looking for this exact same feature but for build_args. In docker-compose, if you don't pass a value to an environment or build_arg key, it will get the value from the runtime environment variables if it exists.

This issue is exactly about this, but only environment was mentioned, not build_args. If you want me to open another issue still I would be happy to do so.

@charleskorn
Copy link
Collaborator

I'd consider support for environment variables in build args to be a different feature to what's been requested in this issue, so please open a separate issue.

@charleskorn
Copy link
Collaborator

I'm going to close this as won't fix - the existing syntax, while verbose, is more explicit and means we can use standard YAML maps rather than a list which needs to be parsed.

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

No branches or pull requests

3 participants