Open felipelima-circle opened 1 week ago
This is due to the compose file processing logic: compose.yaml is first parsed and interpolated, then compose select services to run and ignores others. To implement requested feature so that docker compose up service_1
does not trigger interpolation on service_2
, the loader would need to be aware about selected services. But then interpolating service_1
might reveal a dependency to service_2
(based on some depends_on
or network_mode
attribute) and need to also interpolate the target ... So basically we would have to fully redesign the compose-go library for this purpose
Yeah, I thought about that, but I wonder if we could defer variable interpolation until when the services actually run, rather than during the initial load.
we can't as go is a typed language, so interpolation has to take place before we build a compose-go Project
from yaml, so that (for illustration) port 80
is mapped to a uint32
Not sure if it helps, but environment variables are always string. https://pkg.go.dev/os#Getenv
Description
Description
The
docker compose
command outputs warnings about environment variables not being set, even when those variables are only used in services that are not currently being started.For example, when running
docker compose --profile profile1 up
ordocker compose up service_1
, I get the following warning:You can use this
docker-compose.yml
file to reproduce the problem:Environment