Files
floci/docs/configuration
Kurt McAlpine a574a6d01f fix(docker): keep host network mode for containers that publish ports (#4192)
* fix(docker): keep host network mode for containers that publish ports

A spec with port bindings skipped HostConfig.NetworkMode on create and
connected to the network after start, which Docker refuses for host,
none and container:<id>. Such containers silently stayed on the default
bridge with a published port, so an OpenSearch domain under
FLOCI_SERVICES_DOCKER_NETWORK=host stopped listening on the host's :9200
once domains always published a host port (#2798).

Namespace network modes now always go on the HostConfig, their port
bindings are dropped since Docker publishes nothing there, and the
post-start connect is skipped. A host-network container's endpoint
resolves to localhost when Floci itself runs in Docker instead of a
null host.

* fix(docker): resolve container:<id> endpoints through the owning container

resolveEndpoint only special-cased host, so a container sharing another
container's network namespace fell through to resolveContainerIp, which
has no network to read, and Floci stored a null host for it. The
endpoint now follows HostConfig.NetworkMode to the owning container:
localhost when that container is on the host network, otherwise its IP
on the Docker network. Reading the mode from the inspect rather than the
spec also covers adopted containers.

* test(docker): pass portBindingHostIps to the network test spec helper

ContainerSpec gained a 28th component in #4175 after this branch was cut, so the spec(...) helper added here no longer compiled once rebased onto main.
2026-09-23 18:31:09 -04:00
..