Skip to content

Failing to start when using DOCKER_HOST #605

@groknt

Description

@groknt

When I use Docker Socket Proxy, and set Ofelia's DOCKER_HOST environment variable to it (tcp://ofelia-socket-proxy:2375), Ofelia fails to start and errors.

This is the output containing the errors - first one is normal for the setup, but the rest are the issues:

ofelia-1  | time=2026-05-13T06:39:58.373Z level=WARN source=github.com/netresearch/ofelia/cli/daemon.go:99 msg="Could not load config file \"/etc/ofelia/config.ini\": failed to load config file \"/etc/ofelia/config.ini\": open /etc/ofelia/config.ini: no such file or directory\n  → Check file exists and is readable: ls -l \"/etc/ofelia/config.ini\"\n  → Verify file path is correct\n  → Check file permissions (should be readable)"
ofelia-1  | time=2026-05-13T06:39:58.373Z level=ERROR source=github.com/netresearch/ofelia/cli/daemon.go:122 msg="Can't start the app: SDK provider failed to connect to Docker: pinging docker: Cannot connect to the Docker daemon at tcp://ofelia-socket-proxy:2375. Is the docker daemon running?"
ofelia-1  | SDK provider failed to connect to Docker: pinging docker: Cannot connect to the Docker daemon at tcp://ofelia-socket-proxy:2375. Is the docker daemon running?
ofelia-1  | time=2026-05-13T06:39:58.373Z level=ERROR source=github.com/netresearch/ofelia/ofelia.go:132 msg="Command failed to execute"
Docker Compose Configuration
networks:
  ofelia-socket-proxy:

services:
  ofelia:
    image: ghcr.io/netresearch/ofelia:0.24.0
    restart: unless-stopped
    healthcheck:
      test: pgrep ofelia >/dev/null || exit 1
      interval: 30s
      timeout: 5s
      start_period: 60s
      start_interval: 2s
      retries: 3
    networks:
      - ofelia-socket-proxy
    environment:
      DOCKER_HOST: tcp://ofelia-socket-proxy:2375
      OFELIA_DOCKER_EVENTS: true
      OFELIA_DOCKER_NO_POLL: true
      OFELIA_DOCKER_INCLUDE_STOPPED: false
      OFELIA_ENABLE_PPROF: false
      OFELIA_ENABLE_WEB: false
      OFELIA_LOG_LEVEL: warn
    labels:
      wud.watch: true
      wud.display.name: core/ofelia
      wud.tag.include: ^\d+\.\d+\.\d+$$
      wud.trigger.include: smtp.notify
    depends_on:
      ofelia-socket-proxy:
        condition: service_healthy

  ofelia-socket-proxy:
    image: ghcr.io/tecnativa/docker-socket-proxy:v0.4.2
    restart: unless-stopped
    healthcheck:
      test: wget -t1 -T4 -qO- http://127.0.0.1:2375/_ping | grep -q "OK" || exit 1
      interval: 30s
      timeout: 5s
      start_period: 60s
      start_interval: 2s
      retries: 3
    networks:
      - ofelia-socket-proxy
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    environment:
      LOG_LEVEL: warning
      CONTAINERS: 1
      POST: 1
      EXEC: 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdockerPull requests that update docker codegoPull requests that update go code

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions