refactor(docker): read the Docker host override from floci.docker.host-override (#10025)

The Docker host override every container Floci starts relies on was
read from the Lambda section by core classes. floci.docker.host-override
(env FLOCI_DOCKER_HOST_OVERRIDE) is now the key, read through
EmulatorConfig.effectiveDockerHostOverride() by DockerHostResolver and
TlsProxyServer. It wins when set and not blank; otherwise the former
floci.services.lambda.docker-host-override still applies, giving every
reader the value it gave before, and its first use logs a deprecation
warning. The docs say which key wins and that the self-signed TLS
certificate does not name the override.
This commit is contained in:
Hector Ventura authored and GitHub committed 2026-12-02 23:24:29 -04:00
1 parent 2a2c51abe5
commit 5fffd9f3a8
19 files changed
+358 -31

No files matched your search

+11 -5
View File
@@ -799,7 +799,7 @@ Configuration resource reads and `ListFunctionsByCodeSigningConfig` return
| `FLOCI_SERVICES_LAMBDA_DOCKER_NETWORK` | *(unset)* | Docker network to attach Lambda containers to (overrides `FLOCI_SERVICES_DOCKER_NETWORK`) |
| `FLOCI_SERVICES_LAMBDA_DOCKER_FLAGS` | *(unset)* | Additional Docker flags applied to Lambda containers, including `--env`, `--volume`, `--publish`, `--add-host`, `--dns`, `--label`, `--network`, `--user`, `--privileged`, and `--platform`. Explicit `--dns` entries replace automatic embedded DNS and public fallback resolvers. Published ports support `host:container` and `127.0.0.1:host:container` forms |
| `FLOCI_SERVICES_LAMBDA_EXTRA_HOSTS` | *(unset)* | Comma-separated `hostname:ip` entries added to each Lambda container's `/etc/hosts`; `ip` may be `host-gateway`, mirroring `docker run --add-host` |
| `FLOCI_SERVICES_LAMBDA_DOCKER_HOST_OVERRIDE` | *(unset)* | Explicit host/IP that spawned Lambda containers use to reach Floci's Runtime API, bypassing auto-detection |
| `FLOCI_SERVICES_LAMBDA_DOCKER_HOST_OVERRIDE` | *(unset)* | Deprecated: use `FLOCI_DOCKER_HOST_OVERRIDE` (see [Runtime API host override](#runtime-api-host-override)), which wins when both are set |
| `FLOCI_SERVICES_LAMBDA_CONTAINER_NAME_PREFIX` | `floci` | Base name prefix for spawned Lambda containers and code volumes (e.g. `acme` → `acme-<function>-<id>` containers, `acme-code-<function>-<hash>` volumes; with `FLOCI_DOCKER_RESOURCE_NAMESPACE` set, the namespace follows the prefix and a short hash of it ends the volume name, e.g. `acme-<namespace>-code-<function>-<hash>-<namespace hash>`). Must be a valid Docker name segment (`[A-Za-z0-9][A-Za-z0-9_.-]*`); invalid values are ignored with a warning |
| `FLOCI_SERVICES_LAMBDA_CODE_VOLUME_POPULATE_CONCURRENCY` | `max(2, cpus/2)` | Maximum concurrent first-time code-volume populates. See the note below |
| `FLOCI_SERVICES_LAMBDA_EXECUTOR` | `docker` | Execution backend: `docker` (containers), `kubernetes` (pods) or `process` (local processes, see [Process executor](#process-executor)) |
@@ -925,14 +925,20 @@ correct and needs no configuration.
On unusual network topologies, for example rootless Podman, auto-detection
can pick an address the Lambda container cannot reach, and invocations fail with
`connect ECONNREFUSED <ip>:12000`. Set `FLOCI_SERVICES_LAMBDA_DOCKER_HOST_OVERRIDE`
to the host or IP that containers can actually reach Floci on, and Floci uses it
verbatim instead of auto-detecting:
`connect ECONNREFUSED <ip>:12000`. Set `FLOCI_DOCKER_HOST_OVERRIDE`
(`floci.docker.host-override`) to the host or IP that containers can actually
reach Floci on, and Floci uses it verbatim instead of auto-detecting:
```bash
FLOCI_SERVICES_LAMBDA_DOCKER_HOST_OVERRIDE=floci
FLOCI_DOCKER_HOST_OVERRIDE=floci
```
The override applies to every container Floci starts, not only Lambda's. The
former key `floci.services.lambda.docker-host-override`
(`FLOCI_SERVICES_LAMBDA_DOCKER_HOST_OVERRIDE`) still works when the new one is
unset, and Floci logs a deprecation warning the first time it uses it. When both
are set, `FLOCI_DOCKER_HOST_OVERRIDE` wins.
See [Docker Configuration → Running on Podman (rootless)](../configuration/docker.md#running-on-podman-rootless)
for a full rootless Podman walkthrough.