compose-go
compose-go copied to clipboard
Add an option to only warn about missing variables in `build` section
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.
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.
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