jittering / traefik-kop

A dynamic docker->redis->traefik discovery agent
MIT License
200 stars 15 forks source link

#Question - Docker Socket Proxy 🦄 #40

Closed TCS-UK closed 1 month ago

TCS-UK commented 1 month ago

Hiya,

Do you have any plans to add docker-socket-proxy compatibility so we can connect to the docker socket via TCP?

Tecnativa Github

chetan commented 1 month ago

If the api is compatible with normal clients then I don't see why it wouldn't work out of the box. Have you tried it?

TCS-UK commented 1 month ago

Now I feel an idiot…no I haven’t. The read me sort of indicated that it only worked with the docker socket and nothing else. I’ll give it ago later and report back 👍

chetan commented 1 month ago

I've had problems with http in the past but it may work now. Just give it a shot and report back

TCS-UK commented 1 month ago

I've had problems with http in the past but it may work now. Just give it a shot and report back

🤦‍♂️ IT WORKS 🤣

services:
  traefik-kop:
    image: "ghcr.io/jittering/traefik-kop:latest"
    container_name: traefik-ktop-redis
    security_opt:
      - no-new-privileges:true
    depends_on:
      - traefik-socket-proxy
    restart: unless-stopped

    environment:
      - "DOCKER_HOST=tcp://traefik-socket-proxy:2375"
      - "REDIS_ADDR=192.168.5.209:32768"
      - "BIND_IP=192.168.5.210"
      - "REDIS_PASS=REDACTED"

########################################################################################################

  traefik-socket-proxy:
    image: tecnativa/docker-socket-proxy
    container_name: traefik-socket-proxy
    security_opt:
      - no-new-privileges:true
    restart: unless-stopped
    expose:
      - 2375
    environment:
      LOG_LEVEL: info
      CONTAINERS: 1
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
chetan commented 1 month ago

Awesome, that's great to hear! Thank you for reporting back. I honestly don't remember what issues I had with http but in my dev environment I most often connect over ssh which wasn't working for whatever reason. I'm just using traefik itself to connect to docker which in turn is using the upstream docker client, so perhaps the issue was fixed at some point.

I'll try to update the docs later on and may include your socket proxy example as well. Have not seen that project before but it looks neat.

aksagg commented 1 month ago

Exactly what I was looking for! Thanks!