Context
Reported in #522 — when using a Docker Socket Proxy (or any TCP-based Docker host), ofelia fails to start if Docker isn't immediately reachable. The daemon pings Docker exactly once at startup and exits fatally if it fails.
This affects all TCP-based setups: socket proxies, remote Docker hosts, Docker-in-Docker.
Current Behavior
initDockerHandler() calls provider.Ping() once
- If the ping fails (30s dial timeout), the daemon exits with
"SDK provider failed to connect to Docker: pinging docker"
- No retry, no backoff, no configuration option to wait
Relevant code: cli/docker_config_handler.go lines 178-180 and 129-132.
Proposed Behavior
Add retry with exponential backoff on the initial Docker connection:
- Default: 5 retries, 1s → 2s → 4s → 8s → 16s backoff (total ~31s)
- Configurable via
--docker-retry-count / OFELIA_DOCKER_RETRY_COUNT and --docker-retry-interval / OFELIA_DOCKER_RETRY_INTERVAL
- Log each retry attempt at WARN level
- Keep the current behavior as default (retry count = 0 means no change)
Workarounds
Users can currently work around this with:
depends_on + condition: service_healthy in Docker Compose
restart: unless-stopped on the ofelia container
Context
Reported in #522 — when using a Docker Socket Proxy (or any TCP-based Docker host), ofelia fails to start if Docker isn't immediately reachable. The daemon pings Docker exactly once at startup and exits fatally if it fails.
This affects all TCP-based setups: socket proxies, remote Docker hosts, Docker-in-Docker.
Current Behavior
initDockerHandler()callsprovider.Ping()once"SDK provider failed to connect to Docker: pinging docker"Relevant code:
cli/docker_config_handler.golines 178-180 and 129-132.Proposed Behavior
Add retry with exponential backoff on the initial Docker connection:
--docker-retry-count/OFELIA_DOCKER_RETRY_COUNTand--docker-retry-interval/OFELIA_DOCKER_RETRY_INTERVALWorkarounds
Users can currently work around this with:
depends_on+condition: service_healthyin Docker Composerestart: unless-stoppedon the ofelia container