Skip to content

Diun Endpoint Not Working With Docker Socket Proxy  #1225

Description

@itsbaraa

Support guidelines

I've found a bug and checked that ...

  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

I'm getting this error:
ERR Cannot create Docker client error="Cannot connect to the Docker daemon at tcp://dockerproxy1:2375. Is the docker daemon running?"
No matter what configuration I did with Diun and Docker socket proxy.

Similar to #308 but I have tried the same docker compose file in that issue and it didn't work.

Expected behaviour

Endpoint should change to the docker socket proxy.

Actual behaviour

ERR Cannot create Docker client error="Cannot connect to the Docker daemon at tcp://dockerproxy1:2375. Is the docker daemon running?"

Steps to reproduce

Run the docker compose file below and check the logs.

Diun version

v4.28.0

Docker info

Client: Docker Engine - Community
 Version:    27.0.3
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.15.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.28.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 29
  Running: 28
  Paused: 0
  Stopped: 1
 Images: 26
 Server Version: 27.0.3
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 2bf793ef6dc9a18e00cb12efb64355c2c9d5eb41
 runc version: v1.1.13-0-g58aa920
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.1.0-23-amd64
 Operating System: Debian GNU/Linux 12 (bookworm)
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 15.48GiB
 Name: debian
 ID: 9d15d979-adc4-4828-b60f-0bac341bfd4f
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Docker Compose config

services:
  dockerproxy1:
    image: ghcr.io/tecnativa/docker-socket-proxy:latest
    container_name: dockerproxy1
    environment:
      - CONTAINERS=1
      - IMAGES=1
    ports:
      - 127.0.0.1:2375:2375
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    restart: unless-stopped

  diun:
    image: crazymax/diun:latest
    container_name: diun
    command: serve
    volumes:
      - ./data:/data
    environment:
      - TZ=Asia/Riyadh
      - LOG_LEVEL=info
      - LOG_JSON=false
      - DIUN_WATCH_WORKERS=20
      - DIUN_WATCH_SCHEDULE=0 5 * * *
      - DIUN_WATCH_JITTER=30s
      - DIUN_PROVIDERS_DOCKER=true
      - DIUN_PROVIDERS_DOCKER_WATCHBYDEFAULT=true
      - DIUN_NOTIF_DISCORD_WEBHOOKURL=mywebhookgoeshere
      - DIUN_NOTIF_DISCORD_RENDERFIELDS=true
      - DIUN_NOTIF_DISCORD_TIMEOUT=10s
      - DIUN_NOTIF_DISCORD_TEMPLATEBODY=New Update Available for {{.Entry.Image}}
      - DIUN_PROVIDERS_DOCKER_ENDPOINT=tcp://dockerproxy1:2375
    restart: always

Logs

Tue, 30 Jul 2024 11:06:16 +03 INF Starting Diun version=v4.28.0
Tue, 30 Jul 2024 11:06:16 +03 INF Configuration loaded from 11 environment variable(s)
Tue, 30 Jul 2024 11:06:16 +03 INF Cron triggered
Tue, 30 Jul 2024 11:06:16 +03 ERR Cannot create Docker client error="Cannot connect to the Docker daemon at tcp://dockerproxy1:2375. Is the docker daemon running?" provider=docker
Tue, 30 Jul 2024 11:06:16 +03 WRN No image found
Tue, 30 Jul 2024 11:06:16 +03 INF Jobs completed added=0 failed=0 skipped=0 unchanged=0 updated=0
Tue, 30 Jul 2024 11:06:16 +03 INF Cron initialized with schedule 0 5 * * *
Tue, 30 Jul 2024 11:06:16 +03 INF Next run in 17 hours 53 minutes (2024-07-31 05:00:05.066452953 +0300 +03)

Additional info

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions