compose-go icon indicating copy to clipboard operation
compose-go copied to clipboard

Add an option to only warn about missing variables in `build` section

Open milas opened this issue 2 years ago • 1 comments

When building images with Compose (i.e. docker compose build), you can get warnings in the output like:

WARNING: The "FOO" variable is not set. Defaulting to a blank string.

This warning only makes sense [when building] if the variable is used in the build section (or image since that's the tag that'll be used).

If the variable is only used for things like environment or other runtime options, it doesn't affect the build.

This also applies to buildx bake, which parses Compose files to merge with HCL.

milas avatar Oct 13 '23 16:10 milas

This would require docker/compose let the loader know about sections it could ignore. While feasible, this sounds a significant complexity to be added for the benefits of getting rid with a warning.

ndeloof avatar Apr 17 '24 10:04 ndeloof

this is a general issue we interpolate the whole config file while current command only requires a subset. I wish we get some "lazy-interpolation" mechanism but this would require a full re-architecture and API changes. Maybe a plan for compose-go/v3 ? Closing this one as "not-planned" in the meantime

ndeloof avatar Sep 05 '24 06:09 ndeloof