Closed meyayl closed 1 week ago
app_protocol
is plain metadata and has no impact on docker engine
Need to check about mode
. Maybe a change in Docker engine, or something missing in compose
app_protocol
is plain metadata and has no impact on docker engine
I am was uncertain, as the documentation is slightly ambiguous about it:
app_protocol: The application protocol (TCP/IP level 4 / OSI level 7) this port is used for. This is optional and can be used as a hint for Compose to offer richer behavior for protocols that it understands. Introduced in Docker Compose version 2.26.0.
What exactly does it do then? And what are the protocols it understands?
Regarding host
:. it seems to be ignored, and as such we get the default behavior of the Docker Engine.
On that note,:the default behavior in Docker 26.x.x looks like what we know from mode: host
for swarm services: the source ip is retained.
May I ask what the intended implementation for mode: ingress
is? Should it behave like it does for swarm services and allow to loadbalance to replicas?
What exactly does it do then? And what are the protocols it understands?
This was introduced in the compose specification for parity with Kubernetes model and potential future improvements. This is unused for now in docker compose
About mode
, AFAICT on a standalone docker engine this parameter is not relevant. This attribute was introduced in the compose file format by swarm, and is ignored in Docker Compose codebase
While the spec is confusing as such attributes comes from distinct sources and are not all implemented, what are you trying to achieve here ?
My main objective is to prevent end user confusion :)
Back in the day when we had the v2 and v3 schema reference, I felt it helped a great deal that it pointed out when a particular feature was not available for swarm stack deployments, even though it was part of the schema version.
I kind of miss that in the current compose specification docs. I understand they refer to the specs themselves. I assume most users use docker compose
v2. They find a documentation that is not on par with docker compose
.
swarm does not use compose-specification, so you won't find any detail on supported feature unfortunately. About supported features, we added tags in the spec (see https://github.com/compose-spec/compose-spec/blob/master/05-services.md#attach for example) to help user know minimal required version needed so they can rely on those.
Description
Current behavior:
app_protocol
andmode
are silently ignored and do not end up in created containersmode: host
-> Docker 26.1.4: retains the remote ip, Docker < 26.0.0: uses bridge network gateway ipmode: ingress
Docker 26.1.4 retains the remote ip, Docker < 26.0.0: uses bridge network gateway ipmode: host
. For Docker version < 26.0.0 the behavior matches the documentationExpected behavior with Docker 26.1.4 and later:
app_protocol
andmode
end up in created containers and have an effect, or at least inform the user they are not appliedmode: host
retains the source/remote ipmode: ingress
does not retain the remote ip, but supports replicasmode: ingress
is default)Steps To Reproduce
docker compose up -d
$ docker inspect --format '{{json .NetworkSettings.Ports}}' whoami | jq { "80/tcp": [ { "HostIp": "0.0.0.0", "HostPort": "28888" }, { "HostIp": "::", "HostPort": "28888" } ] }
$ docker inspect --format '{{json .NetworkSettings.Ports}}' whoami-host | jq { "80/tcp": [ { "HostIp": "0.0.0.0", "HostPort": "18888" } ] }
Docker Environment
Anything else?
No response