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
Docker build environment config precedence #13718
Comments
OK, now I remember the reason why it is the way it is. It comes from how the Docker So, it depends how you look at this option, what to expect, really. And I'm not sure if there is one correct answer. We could use both, controlled by a feature toggle option.. (yet another option), so not sure if that is desirable. |
I tend to think that it's right the way it is, for the reason you state - it mirrors how |
Thanks @benjyw. Trying to figure out how to have a default value in the configuration, that can be overridden by env var.. hmm, perhaps a separate pants.toml file is the answer to that.. 🤔 |
Just my two cents, but also feel that it makes sense to have the "hardcoded" values take precedence over any env variables that happen to be set in your local environment, unless explicitly overridden. If I want to spin up a docker container I don't want to have to unset every local env variable to be able to do so. |
My gut reaction is "don't do that" :) There is a cost to complexity. And there is already a lot of flexibility built in here. |
Ok, yeah let's close this as "not a bug". :) |
Describe the bug
I think this precedence is backwards:
https://github.com/pantsbuild/pants/blob/main/src/python/pants/backend/docker/util_rules/docker_build_env_test.py#L44-L46
Pants version
bleeding edge
OS
Any.
Additional info
I think that whatever value you have in your environment should be used over any hardcoded value in your configuration. So that the configuration may be used as a default fallback value, and the environment can be used to override that as required.
I would expect the
DOCKER_HOST
setting in the env to be respected there.. it is currently not.The text was updated successfully, but these errors were encountered: