Files
floci/docs/configuration/docker.md
T
Hector Ventura 9af8ca07a9 feat(docker): see Lambda container exits through one Docker events subscription, behind a flag (#9175)
Every running Lambda container held a /wait stream, a streaming connection and a thread, only to notice its runtime exiting. With floci.docker.events-exit-detection on (off by default), DockerExitEvents watches them all through one events subscription filtered to container die events, as the AWS ECS agent does. Because events are edge-triggered, a container is registered before it starts and the first subscription is confirmed before the registration returns; after the stream drops, it subscribes again and inspects every watched container, reporting the ones that exited or died in the gap and never one still being created. The exit code comes from an inspect, with the event's exitCode attribute as the fallback, and each exit is reported once, on a virtual thread. With the flag off, LambdaExitWatcher runs as before.

A dropped or unconfirmed stream marks a sweep that the next subscription to start runs, whoever opened it. An inspect in the sweep that fails with anything but NotFound is tried again on a doubling delay, and only a subscription Docker confirms resets the reconnect backoff.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-11-22 14:59:18 -04:00

451 lines
29 KiB
Markdown

# Docker Configuration
Floci spawns real Docker containers for services that need them: Lambda, RDS, ElastiCache, OpenSearch, MSK, and ECS. All of these share the same Docker client configuration, controlled under `floci.docker`.
## Docker Daemon Socket
By default Floci connects to the local Docker daemon via the Unix socket. Override it with `docker-host` when needed (e.g. a remote Docker host or a non-standard socket path):
```yaml
floci:
docker:
docker-host: unix:///var/run/docker.sock
```
**Running natively on Windows** (not inside WSL or a container): Windows has no equivalent of `/var/run/docker.sock`, so when `docker-host` is left at its default and `DOCKER_HOST` isn't set, Floci automatically falls back to Docker Desktop's named pipe (`npipe:////./pipe/docker_engine`) instead. An explicit `docker-host` or `DOCKER_HOST` always takes priority over this fallback.
Environment variable: `FLOCI_DOCKER_DOCKER_HOST`
When running Floci inside Docker Compose, mount the host socket:
```yaml
services:
floci:
volumes:
- /var/run/docker.sock:/var/run/docker.sock
```
The container normally switches to the unprivileged `floci` user (UID 1001), including when started with `--user root`. If the mounted socket is accessible only to root, set the entrypoint option `FLOCI_RUN_AS_ROOT=true` to keep Floci running as root:
```bash
docker run --rm -p 4566:4566 \
-v /var/run/docker.sock:/var/run/docker.sock \
-e FLOCI_RUN_AS_ROOT=true \
floci/floci:latest
```
In Docker Compose, use the same environment variable:
```yaml
services:
floci:
image: floci/floci:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
FLOCI_RUN_AS_ROOT: "true"
```
Use this only when the socket's permissions require root. Without the option, Floci retains its unprivileged default. The setting applies to the container entrypoint, not to `floci.docker` configuration.
The entrypoint needs to start as root to read the socket's group and to honour this option. A container started as a non-root user, with `--user 1001` or a Kubernetes `runAsUser`, skips both, so give it the socket's group yourself: `--group-add "$(stat -c '%g' /var/run/docker.sock)"`.
## Connection Pool
Floci's short Docker calls (create, start, stop, remove and the like) go through one client with a bounded connection pool. When it is full, every other Docker call waits for a connection to free up, and Floci stops making progress. Streams that stay open while they run use the separate streaming pool below, so this pool only fills under a burst of short calls.
The default is 1024 connections:
```yaml
floci:
docker:
max-connections: 1024
```
Environment variable: `FLOCI_DOCKER_MAX_CONNECTIONS`
Streams that stay open for as long as a container or a command runs use a second, separate pool, so they can never starve create, start, stop and remove calls. Each Lambda container holds two of these (its log stream and the watcher that notices its runtime exiting) plus one per Lambda extension; short-lived containers' log streams use it too (a long-lived service container's log is read on a timer instead, see [Container Log Settings](#container-log-settings)), and so does the output of each long-running command: CodeBuild build phases, SSM run commands, ECS Exec sessions, EKS audit log followers, ECR garbage collection, EC2 and EKS user data and EMR bootstrap actions. The default of 3072 covers the 500 concurrent Lambda containers the default [Runtime API port range](../services/lambda.md#configuration) allows, with two extensions each (2000 connections), and leaves about 1000 for every other stream. Raise it if you widen that range, or run many builds, sessions or other containers at the same time. It follows the same rule (at least 1):
```yaml
floci:
docker:
streaming-max-connections: 3072
```
Environment variable: `FLOCI_DOCKER_STREAMING_MAX_CONNECTIONS`
When a pool is full, a Docker call waits for a free connection, then fails. The wait defaults to 30 seconds for both pools and must be at least 1 (httpclient5 reads 0 as no limit, so a call would wait forever); a failed wait is not retried, because a full pool means Floci is saturated:
```yaml
floci:
docker:
connection-request-timeout-seconds: 30
```
Environment variable: `FLOCI_DOCKER_CONNECTION_REQUEST_TIMEOUT_SECONDS`
A Docker call that gets no response within `api-timeout-seconds` fails, on Unix-socket and TCP hosts alike, so a hung daemon cannot block a request indefinitely. A request that is safe to repeat is retried after a transient connection error, but only within the same limit, counted from its first attempt: no retry starts once the limit would pass, so a silent daemon fails the call after about the limit. An attempt already running is not cut short, so a fast failure followed by a silent retry can take up to twice the limit. It defaults to 300 seconds (5 minutes) for both pools and must be at least 1, since httpclient5 reads 0 as no limit. Requests that follow a container for as long as it runs (container waits, exec and attach output, followed logs, streamed stats, daemon events, image pulls and builds) have no such limit, since they can stay silent while healthy:
```yaml
floci:
docker:
api-timeout-seconds: 300
```
Environment variable: `FLOCI_DOCKER_API_TIMEOUT_SECONDS`
An image pull has a limit of its own: each attempt may take up to `image-pull-timeout-seconds`, 300 seconds (5 minutes) by default. A pull still downloading when the limit passes fails that attempt with "Could not pull image: Downloading" and is tried again, three attempts in all, so a launch that needs an image Docker does not have yet can wait up to about three times the limit before it fails; a pull that has reported no progress at all within the limit fails at once with "Timed out pulling image". A large image, such as an EMR Serverless runtime of 3.5 to 4.3 GB, can need longer on a slow connection: raise the limit, or pull the image with `docker pull` before the first launch. It must be at least 1:
```yaml
floci:
docker:
image-pull-timeout-seconds: 300
```
Environment variable: `FLOCI_DOCKER_IMAGE_PULL_TIMEOUT_SECONDS`
To see how close Floci is to those limits, it logs a line every `pool-gauge-interval-seconds` (60 by default) while a pool is in use, and nothing while both are idle. Each pool reports its leased, available and pending connections against its limit and its open streams by kind and by the service whose container each one follows, followed by the number of docker-java stream threads:
```
Docker pools: control-plane leased=2 available=6 pending=0 max=1024; streaming leased=40 available=0 pending=0 max=3072 streams[logs=20 wait=20] services[lambda=36 unattributed=4]; stream threads=40
```
A stream is `unattributed` when it follows no container (an exec, an image pull or build, daemon events), or a container this Floci process did not start with a service label: one started before a restart, by a tool other than Floci, or by a Floci helper that labels no service.
Each open stream is read on a virtual thread of its own, so `stream threads` counts the streams being read and costs no platform thread each. Virtual threads do not appear in a plain `jstack`; `jcmd <pid> Thread.dump_to_file -format=json <file>` lists them.
A `pending` above 0 means calls are waiting for a connection, and a call that waits longer than `connection-request-timeout-seconds` fails. To turn the lines off, set the interval to 0:
```yaml
floci:
docker:
pool-gauge-interval-seconds: 0
```
Environment variable: `FLOCI_DOCKER_POOL_GAUGE_INTERVAL_SECONDS`
### Unreachable daemon
When the Docker daemon stops answering, Floci stops waiting on it. After `breaker-failure-threshold` attempts in a row (3 by default) fail before the daemon answers (a broken connection, a refused or missing socket, a call that times out), Floci pings the daemon. Each retry of a call is an attempt, so a single call that Floci retries can reach the threshold on its own; the ping is what keeps that from turning Docker off. If the ping fails too, every Docker call fails at once instead of waiting out its own connect, response and retry timeouts, so a container-backed request reports a missing daemon in about a second. Floci logs one warning when this starts, pings the daemon every `breaker-probe-interval-seconds` (5 by default), and logs one line when it answers again. An error status from the daemon (a 404, a 500) is an answer and never counts, for a call or for the ping, and a ping that never reaches the daemon (Floci shutting down) neither turns Docker off nor back on. The ping uses a connection of its own and gives up after 5 seconds. Set the threshold to 0 to turn this off:
```yaml
floci:
docker:
breaker-failure-threshold: 3
breaker-probe-interval-seconds: 5
```
Environment variables: `FLOCI_DOCKER_BREAKER_FAILURE_THRESHOLD`, `FLOCI_DOCKER_BREAKER_PROBE_INTERVAL_SECONDS`
### Concurrent container launches
Floci sends at most `max-concurrent-launches` container creates and starts to the daemon at once, so a burst of container work (a pipeline stage starting a dozen containers, a fan-out of Lambda cold starts) reaches it a few at a time instead of all at once. The rest wait up to `connection-request-timeout-seconds` for one to finish, and a launch that waits longer fails. The default, 0, means twice the CPUs Floci sees and at least 4. Image pulls, stops, removes and every other Docker call are not limited by it:
```yaml
floci:
docker:
max-concurrent-launches: 0
```
Environment variable: `FLOCI_DOCKER_MAX_CONCURRENT_LAUNCHES`
### Per-service container budgets
`service-max-containers` caps how many containers one service may run at once, keyed by the service's `io.floci.service` label, so one busy service cannot take every container the Docker host can hold. A request that would start one more fails at once with the capacity or limit error that service's API declares, so the SDK reports it the way it would on AWS: Lambda `Invoke` answers `TooManyRequestsException` (429, retried by the SDKs, and an asynchronous invocation is retried like a throttled one), RDS `InsufficientDBInstanceCapacity`, ElastiCache `InsufficientCacheClusterCapacity`, Redshift `InsufficientClusterCapacity`, MemoryDB `InsufficientClusterCapacityFault`, DocumentDB and Neptune `DBClusterQuotaExceededFault`, MSK `TooManyRequestsException`, OpenSearch `LimitExceededException`, CodeBuild `AccountLimitExceededException`, SageMaker `ResourceLimitExceeded` and Glue `ConcurrentRunsExceededException`; a service without such an error gets `ThrottlingException`. A job that starts its container after the request returns (a build, a training job, a Glue run, an ECS task) fails the job instead. A Lambda container left warm counts until a launch needs its slot: the least recently used idle container of any function is stopped first, and an invoke is throttled only when none is idle. The count is of the containers Floci created and has not removed, so one removed outside Floci (`docker rm`, a prune) keeps its slot until Floci restarts. No service is limited by default:
```yaml
floci:
docker:
service-max-containers:
lambda: 50
rds: 4
```
Environment variables: `FLOCI_DOCKER_SERVICE_MAX_CONTAINERS_<SERVICE>`, with the label in upper case (`FLOCI_DOCKER_SERVICE_MAX_CONTAINERS_LAMBDA=50`)
### Container exits through Docker events
Each running Lambda container holds a streaming connection whose only job is to notice its runtime exiting, so an invocation reports `Runtime.ExitError` at once instead of waiting out its timeout. With `events-exit-detection` on, Floci watches every Lambda container's exit through one Docker events subscription instead, which saves each container that connection and its thread. After the subscription drops (a daemon restart, a lost connection), Floci subscribes again and inspects every watched container, so an exit in the gap is still reported. It is off by default while it proves itself:
```yaml
floci:
docker:
events-exit-detection: false
```
Environment variable: `FLOCI_DOCKER_EVENTS_EXIT_DETECTION`
## Private Registry Authentication
Any service that pulls a container image from a private registry (Lambda image functions, custom OpenSearch images, private Postgres images, etc.) needs Docker credentials. Two approaches are supported and can be combined.
### Mount the host Docker config
Reuses existing `docker login` sessions and credential helpers from the host machine. Mount the host `~/.docker` directory and point Floci at it:
```yaml
services:
floci:
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ~/.docker:/root/.docker:ro
environment:
FLOCI_DOCKER_DOCKER_CONFIG_PATH: /root/.docker
```
Or in `application.yml`:
```yaml
floci:
docker:
docker-config-path: /root/.docker
```
This works with any credential helper configured on the host (`docker-credential-desktop`, `ecr-credential-helper`, etc.) as long as the helper binary is also available inside the Floci container.
### Explicit per-registry credentials
For CI environments or air-gapped setups where mounting the host filesystem is not practical:
```yaml
services:
floci:
environment:
FLOCI_DOCKER_REGISTRY_CREDENTIALS_0__SERVER: myregistry.example.com
FLOCI_DOCKER_REGISTRY_CREDENTIALS_0__USERNAME: myuser
FLOCI_DOCKER_REGISTRY_CREDENTIALS_0__PASSWORD: mypassword
# Add more registries by incrementing the index:
# FLOCI_DOCKER_REGISTRY_CREDENTIALS_1__SERVER: other.registry.io
# FLOCI_DOCKER_REGISTRY_CREDENTIALS_1__USERNAME: ...
# FLOCI_DOCKER_REGISTRY_CREDENTIALS_1__PASSWORD: ...
```
Or in `application.yml`:
```yaml
floci:
docker:
registry-credentials:
- server: myregistry.example.com
username: myuser
password: mypassword
- server: other.registry.io
username: otheruser
password: otherpassword
```
The `server` field must match the registry hostname exactly as it appears in the image URI (e.g. `myregistry.example.com` for `myregistry.example.com/repo:tag`). Docker Hub images (e.g. `ubuntu:22.04`) have an empty hostname and are not matched by any explicit credential entry — use the Docker config mount approach for Docker Hub authentication.
### Precedence
Explicit credentials take precedence for registries they cover. For everything else, Floci falls back to the Docker config file (if `docker-config-path` is set) and then to an anonymous pull.
## Container Log Settings
Floci forwards each container's output to the console and to CloudWatch Logs. A container that runs for one job or invocation (a Lambda function, a build, an ECS task) has its log followed as it is written. A long-lived service container (a database, cache or broker, the ECR registry, the EKS API server) instead has its log read every `log-poll-interval-millis` (1000 by default) with one short call, so it holds no Docker connection between reads. Its lines reach the console and CloudWatch Logs up to one interval later, and its last lines are read between its stop and its removal:
```yaml
floci:
docker:
log-poll-interval-millis: 1000
```
Environment variable: `FLOCI_DOCKER_LOG_POLL_INTERVAL_MILLIS` (at least 100)
Configure log rotation for all containers spawned by Floci:
```yaml
floci:
docker:
log-max-size: "10m" # Max size per log file before rotation (Docker json-file format)
log-max-file: "3" # Number of rotated log files to retain per container
```
## Container Labels
Every container and volume Floci creates carries three reserved labels for discovery and cleanup:
| Label | Value | Purpose |
|---|---|---|
| `floci` | `true` | Umbrella across all Floci emulators — `docker ps --filter label=floci=true` |
| `floci_emulator` | `floci-aws` | Per-emulator discriminator |
| `floci_namespace` | *(the configured namespace)* | Only present when `resource-namespace` is set |
Add your own labels with `extra-labels` — they are applied to every container **and** volume Floci creates (Lambda functions and code volumes, RDS databases, ElastiCache, OpenSearch, MSK, ECS, ...):
```yaml
floci:
docker:
extra-labels:
- key: "com.example.project"
value: my-project
- key: environment
value: dev
```
Or via environment variables (indexed entries, like `registry-credentials`):
```yaml
services:
floci:
environment:
FLOCI_DOCKER_EXTRA_LABELS_0__KEY: "com.example.project"
FLOCI_DOCKER_EXTRA_LABELS_0__VALUE: my-project
FLOCI_DOCKER_EXTRA_LABELS_1__KEY: environment
FLOCI_DOCKER_EXTRA_LABELS_1__VALUE: dev
```
Extra labels are a list of key/value entries rather than a map so that label keys containing dots, colons, or uppercase characters survive the environment-variable naming convention.
!!! note
Entries using one of the reserved keys (`floci`, `floci_emulator`, `floci_namespace`, or any key listed under [Internal Labels](#internal-labels), new or legacy) are ignored with a warning: user configuration can never break Floci's own container discovery and volume pruning, or fake the owner or identity a cleanup path trusts.
### Resource Identity Labels
A container backing an emulated AWS resource also carries labels tying it back to that resource, additive to the labels above:
| Label | Value | Purpose |
|---|---|---|
| `io.floci` | `aws` | Cloud provider, for multi-cloud discovery when several Floci-like emulators share a host |
| `io.floci.service` | e.g. `rds` | The AWS service the container backs |
| `io.floci.resource-id` | e.g. `orders-db-primary` | The resource's identifier (DB instance identifier, cluster name, function name, ...) |
| `io.floci.account` | the resolved account id | The AWS account the resource belongs to |
| `io.floci.region` | the resolved region | The AWS region the resource belongs to |
This makes `docker ps --filter label=io.floci.resource-id=orders-db-primary` resolve a specific emulated resource to its backing container directly, without inferring it from names or creation order. Applied to RDS, DocDB, ElastiCache (Redis/Valkey and Memcached), MemoryDB, Neptune, MSK, OpenSearch, ECS, EKS, AmazonMQ, MWAA, Kinesis Data Analytics (Flink), Batch, CodeBuild, Lambda, and EC2. ECR's backing registry container carries every label except `io.floci.resource-id`, since it is a shared singleton with no single resource identifier. The EventBridge Pipes Kafka bridge carries only `io.floci` and `io.floci.service=pipes`, since one bridge serves every pipe reading the same cluster. The Docker networks backing EC2 VPCs carry `io.floci`, `io.floci.service=ec2`, `io.floci.resource-id` (the VPC id) and `io.floci.region`.
The same key set is used by Floci's GCP, Azure and OCI emulators, each with its own scope keys in place of `io.floci.account` and `io.floci.region` (see the [floci-gcp](https://floci.io/floci-gcp/), [floci-az](https://floci.io/floci-az/) and [floci-oci](https://floci.io/floci-oci/) documentation).
### Internal Labels
Floci also stamps bookkeeping labels it reads back itself: which Floci deployment owns a container or network, which process run created an ECS container, and which containers belong to the security-group sandbox. Each key Floci used before it adopted the `io.floci.*` namespace is still written next to its new key with the same value, and read when the new key is missing, so resources created by an earlier version keep being found. *Legacy: still written, prefer the new key.*
| Label | Legacy alias | On | Value |
|---|---|---|---|
| `io.floci.owner` | `floci_owner_port` | ECS task containers, ECS credentials proxies, EC2 instance containers, security-group helpers | The owning deployment: `<namespace>/<port>`, or the bare API port without a resource namespace |
| `io.floci.owner` | `floci_vpc_owner_port` | EC2 VPC networks | As above |
| `io.floci.ecs.run` | `floci.ecs-run` | ECS task containers and their security-group helpers | The process run that created the container |
| `io.floci.ecs.credentials-proxy` | `floci.ecs-task-role-credentials-proxy` | ECS credentials proxies | `true` |
| `io.floci.security-group.helper` | `floci.security-group-helper` | Security-group helpers | `true` |
| `io.floci.security-group.workload` | `floci.security-group-workload` | Workloads inside a security-group helper's network namespace | `true` |
| `io.floci.component` | `floci.component` | The EventBridge Pipes Kafka bridge | `pipes-kafka-rest-bridge` |
| `io.floci.service=ec2` and `io.floci.component=vpc-network` | `floci_component=ec2-vpc` | EC2 VPC networks | |
| `io.floci.resource-id` | `floci_vpc_id` | EC2 VPC networks | The VPC id |
| `io.floci.region` | `floci_vpc_region` | EC2 VPC networks | The VPC's region |
Startup cleanup acts on an object only when every owner key it carries, new or legacy, names this deployment. An object whose new and legacy labels disagree was relabelled outside Floci and is left alone with a warning.
## Docker Network
Containers spawned by Floci (Lambda, RDS, ElastiCache, OpenSearch, MSK, ECS) need to be on the same Docker network to communicate with each other and with Floci itself.
When Floci itself runs inside Docker and no network is configured, it automatically detects the current container's Docker network and uses it for spawned containers. You only need to set this manually when you want to force a specific network.
Set the shared network at the top level:
```yaml
floci:
services:
docker-network: my-project_default
```
Environment variable: `FLOCI_SERVICES_DOCKER_NETWORK`
Individual services can override the network with their own `docker-network` setting (e.g. `floci.services.lambda.docker-network`).
A network mode of `host`, `none` or `container:<id>` places the spawned containers in that network namespace instead of on a Docker network. Docker publishes no host ports there, so a container on the host network serves its own port directly on the host (an OpenSearch domain listens on `9200` rather than on a port from its configured range), and Floci reaches it via `localhost`. A container placed in another container's namespace (`container:<id>`) is reached through that container's address instead: its IP on the Docker network, or `localhost` when it is itself on the host network.
!!! tip
In Docker Compose, the default network name is `<project-name>_default`. If your compose file is in a directory named `myapp`, the network is `myapp_default`.
## Running on Podman (rootless)
Floci runs under rootless Podman, but Podman's network topology needs a few
explicit settings that Docker handles automatically. The following configuration
is known to work:
```bash
podman network create floci-net
podman run -d --name floci \
--network floci-net \
-p 4566:4566 \
-v /run/user/$(id -u)/podman/podman.sock:/var/run/docker.sock \
--security-opt label=disable \
-e FLOCI_SERVICES_LAMBDA_DOCKER_NETWORK=floci-net \
-e FLOCI_HOSTNAME=floci \
floci/floci
```
What each setting does and why it is needed:
- **Named network (`floci-net`)** — the rootless default bridge does not assign
reachable IPs between containers, so spawned Lambda containers cannot reach
Floci. Create a named network and put both Floci and its Lambda containers on it.
- **`FLOCI_SERVICES_LAMBDA_DOCKER_NETWORK=floci-net`** — makes Floci attach the
Lambda containers it spawns to that same named network.
- **`FLOCI_HOSTNAME=floci`** — gives Floci a stable name that Lambda containers
resolve when calling back to the Runtime API.
- **`--security-opt label=disable`**: turns off SELinux labeling for the Floci
container. With SELinux enforcing, the container's label keeps Floci from
talking to the Podman socket: Lambda/ECR container creation fails with
`java.net.BindException: Permission denied` (or
`java.io.IOException: Broken pipe`), and so does the **Floci UI** sidecar.
Relabeling the mount with `:z` or `:Z` is not a substitute: it fixes access to
the socket file, but SELinux also denies `connectto` on the Podman service at
the other end of the socket.
!!! tip "When the Runtime API address is still unreachable"
On some Podman network topologies the auto-detected Runtime API address
(the host/IP Lambda containers use to call back into Floci) is still wrong,
and invocations fail with `connect ECONNREFUSED <ip>:12000`. Set the address
explicitly to bypass auto-detection:
```bash
FLOCI_SERVICES_LAMBDA_DOCKER_HOST_OVERRIDE=floci
```
This forces every spawned Lambda container to reach the Runtime API at the
given host (here the `FLOCI_HOSTNAME` value), skipping Floci's
auto-detection entirely. See the [Lambda docs](../services/lambda.md#configuration)
for details.
## Transient I/O retry
All of Floci's short-lived docker calls (create/start/inspect/remove container, volume management, image operations) travel one shared daemon socket, and under fan-out load the daemon occasionally drops a connection mid-call with `java.io.IOException: Broken pipe`. Floci retries these transient failures centrally, at the docker transport layer, up to 6 attempts with a capped exponential backoff (500ms base, 8s cap); so every call site is covered without per-call configuration, and a genuine daemon rejection (a 4xx, a name conflict) still surfaces immediately.
A request is only replayed when doing so cannot change semantics: requests carrying a one-shot upload stream (e.g. copying an archive into a container), bidirectional attach streams, and `exec` requests (which would re-run the command) are never retried. Log-follow connections use a separate transport that does not retry at all. Bodyless actions whose replay changes the outcome (unnamed container create, network create, container restart, network connect and disconnect) are not retried either. A tar-writer failure on the Floci host (for example an unreadable source file) is reported at once instead of retried.
Archive uploads that use the shared tar-copy helper retry above the transport layer, rebuilding
the upload stream for each attempt with the same six-attempt backoff. This includes user-data
scripts, the container CA bundle, Verdaccio's configuration, SageMaker model data and training
inputs, Flink log configuration and application properties, and EKS audit policies, IRSA
signing keys, the containerd certificate-directory link and the Pod Identity manifest. Only the
upload is retried, not script execution. Daemon rejections still stop immediately, and each
caller keeps its existing failure handling after retries are exhausted.
## Full Reference
| Environment variable | Default | Description |
|---|---|---|
| `FLOCI_DOCKER_DOCKER_HOST` | `unix:///var/run/docker.sock` | Docker daemon socket |
| `FLOCI_DOCKER_DOCKER_CONFIG_PATH` | _(unset)_ | Path to directory containing Docker's `config.json` |
| `FLOCI_DOCKER_MAX_CONNECTIONS` | `1024` | Connection pool size for Floci's short Docker calls |
| `FLOCI_DOCKER_BREAKER_FAILURE_THRESHOLD` | `3` | Docker call attempts in a row (each retry counts) that fail before the daemon answers, after which a failed ping makes every Docker call fail at once until the daemon answers again; `0` turns this off |
| `FLOCI_DOCKER_BREAKER_PROBE_INTERVAL_SECONDS` | `5` | Seconds between the pings that check whether an unreachable Docker daemon is back |
| `FLOCI_DOCKER_MAX_CONCURRENT_LAUNCHES` | `0` | Most container creates and starts sent to the daemon at once; `0` means twice the CPUs Floci sees, at least 4 |
| `FLOCI_DOCKER_SERVICE_MAX_CONTAINERS_<SERVICE>` | _(none)_ | Most containers one service runs at once, by its `io.floci.service` label; unset means unlimited |
| `FLOCI_DOCKER_EVENTS_EXIT_DETECTION` | `false` | Watch Lambda containers' exits through one Docker events subscription instead of a wait stream per container |
| `FLOCI_DOCKER_STREAMING_MAX_CONNECTIONS` | `3072` | Connection pool size for streams that last a container's lifetime or a long command's run. Each live Lambda container holds two (log stream and exit watcher) plus one per extension, and each CodeBuild phase, SSM command, ECS Exec session, EKS audit follower, user data script and EMR bootstrap action one |
| `FLOCI_DOCKER_REGISTRY_CREDENTIALS_0__SERVER` | _(unset)_ | Registry hostname for credential entry 0 |
| `FLOCI_DOCKER_REGISTRY_CREDENTIALS_0__USERNAME` | _(unset)_ | Username for credential entry 0 |
| `FLOCI_DOCKER_REGISTRY_CREDENTIALS_0__PASSWORD` | _(unset)_ | Password for credential entry 0 |
| `FLOCI_DOCKER_LOG_POLL_INTERVAL_MILLIS` | `1000` | Milliseconds between the reads of a long-lived service container's log (databases, caches, brokers, the ECR registry, the EKS API server), read on a timer instead of followed; at least 100 |
| `FLOCI_DOCKER_LOG_MAX_SIZE` | `10m` | Max container log file size before rotation |
| `FLOCI_DOCKER_LOG_MAX_FILE` | `3` | Number of rotated log files to retain |
| `FLOCI_DOCKER_EXTRA_LABELS_0__KEY` | _(unset)_ | Label key for extra-label entry 0, applied to every Floci-created container and volume (increment the index for more) |
| `FLOCI_DOCKER_EXTRA_LABELS_0__VALUE` | _(unset)_ | Label value for extra-label entry 0 |
| `FLOCI_SERVICES_DOCKER_NETWORK` | _(unset)_ | Shared Docker network for all container-based services |
| `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. See the [Lambda docs](../services/lambda.md#configuration) |