Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple docker sockets? #62

Closed
andyloree opened this issue Aug 6, 2024 · 4 comments
Closed

Multiple docker sockets? #62

andyloree opened this issue Aug 6, 2024 · 4 comments

Comments

@andyloree
Copy link

andyloree commented Aug 6, 2024

Would it be possible to add support for multiple, remote docker hosts? Instead of having to create static files, ability to support multiple docker instances via something like docker-socket-proxy would allow for a non-swarm, stand-alone docker hosts configured via labels. Homepage does this today with labels approach, via a single config file, adding entries for each docker socket: https://gethomepage.dev/v0.8.0/configs/docker/#using-docker-socket-proxy

@BigBoot BigBoot closed this as completed in ba903f6 Aug 7, 2024
@BigBoot
Copy link
Owner

BigBoot commented Aug 7, 2024

AUTOKUMA__DOCKER__HOSTS="tcp://host_1:2375;tcp://host_2:2375" should work.

Also make sure you're on the master tag and have pulled the latest image (or use ghcr.io/bigboot/autokuma:sha-11b6c5d) for the specific build.

@andyloree
Copy link
Author

andyloree commented Aug 7, 2024

Thanks, mistakenly thought latest was getting tagged as the build :)

I got the latest running, but now having an issue with it not liking "tcp://" hosts, it keeps prepending "unix://" schema

# export AUTOKUMA__DOCKER__HOSTS="tcp://apps.[redacted]:2375"
# autokuma
...
WARN [kuma_client::util] Using DOCKER_HOST=unix://tcp://apps.[redacted].com:2375
WARN [autokuma::sync] Encountered error during sync: Error in the hyper legacy client: client error (Connect)

Seems like no matter what is in the env value, its putting unix:// schema on it. I tried a few different variations but no luck.

Looks like code at issue is here, hard-coded to prepend unix://

image

@arhue
Copy link

arhue commented Aug 7, 2024

Hi,

I'm facing exact same issue and it's quite a coincidence that you were working on this at the same time. I have created PR here to fix this: #64. I'm not a programmer and have not written Rust before. Please review/test before merging.

My Docker Swarm config file:

services:
  docker_host:
    image: ghcr.io/tecnativa/docker-socket-proxy:latest
    ports:
      - target: 2375
        published: 2375
        protocol: tcp
        mode: host
    environment:
      CONTAINERS: 1
      SERVICES: 1
      TASKS: 1
      POST: 0
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    deploy:
      mode: global
  autokuma:
    image: ghcr.io/bigboot/autokuma:sha-11b6c5d
    environment:
      AUTOKUMA__KUMA__URL: https://status.transnomis.com
      AUTOKUMA__DOCKER__SOURCE: Both
      AUTOKUMA__DOCKER__HOSTS: "tcp://qa-docker-1.transnomis.com:2375;tcp://qa-docker-3.transnomis.com:2375;tcp://qa-docker-4.transnomis.com:2375;tcp://qa-docker-5.transnomis.com:2375;tcp://qa-docker-6.transnomis.com:2375"
    deploy:
      replicas: 1
  uptimekuma:
    image: louislam/uptime-kuma:1.23.13
    volumes:
      - uptimekuma_data:/app/data
    networks:
      - uptimekuma
      - caddy
    deploy:
      replicas: 1
      placement:
        constraints: [node.hostname == qa-docker-1]
      labels:
        caddy: status.transnomis.com
        caddy.reverse_proxy: "{{ upstreams 3001 }}"
        caddy.tls: "simon@transnomis.com"
        caddy.tls.dns: "godaddy {env.GODADDY_TOKEN}"
networks:
  caddy:
    external: true
  uptimekuma:
    driver: overlay
    attachable: true

volumes:
  uptimekuma_data:

I get the following error:

uptimekuma_autokuma.1.8zmgere8fstc@qa-docker-4    | WARN [kuma_client::util] Using DOCKER_HOST=unix://tcp://qa-docker-1.transnomis.com:2375
uptimekuma_autokuma.1.8zmgere8fstc@qa-docker-4    | WARN [autokuma::sync] Encountered error during sync: Error in the hyper legacy client: client error (Connect)
uptimekuma_autokuma.1.8zmgere8fstc@qa-docker-4    | WARN [kuma_client::util] Using DOCKER_HOST=unix://tcp://qa-docker-1.transnomis.com:2375
uptimekuma_autokuma.1.8zmgere8fstc@qa-docker-4    | WARN [autokuma::sync] Encountered error during sync: Error in the hyper legacy client: client error (Connect)
uptimekuma_autokuma.1.8zmgere8fstc@qa-docker-4    | WARN [kuma_client::util] Using DOCKER_HOST=unix://tcp://qa-docker-1.transnomis.com:2375
uptimekuma_autokuma.1.8zmgere8fstc@qa-docker-4    | WARN [autokuma::sync] Encountered error during sync: Error in the hyper legacy client: client error (Connect)
uptimekuma_autokuma.1.8zmgere8fstc@qa-docker-4    | WARN [kuma_client::util] Using DOCKER_HOST=unix://tcp://qa-docker-1.transnomis.com:2375
uptimekuma_autokuma.1.8zmgere8fstc@qa-docker-4    | WARN [autokuma::sync] Encountered error during sync: Error in the hyper legacy client: client error (Connect)
uptimekuma_autokuma.1.8zmgere8fstc@qa-docker-4    | WARN [kuma_client::util] Using DOCKER_HOST=unix://tcp://qa-docker-1.transnomis.com:2375
uptimekuma_autokuma.1.8zmgere8fstc@qa-docker-4    | WARN [autokuma::sync] Encountered error during sync: Error in the hyper legacy client: client error (Connect)
uptimekuma_autokuma.1.8zmgere8fstc@qa-docker-4    | WARN [kuma_client::util] Using DOCKER_HOST=unix://tcp://qa-docker-1.transnomis.com:2375
uptimekuma_autokuma.1.8zmgere8fstc@qa-docker-4    | WARN [autokuma::sync] Encountered error during sync: Error in the hyper legacy client: client error (Connect)
uptimekuma_autokuma.1.8zmgere8fstc@qa-docker-4    | WARN [kuma_client::util] Using DOCKER_HOST=unix://tcp://qa-docker-1.transnomis.com:2375
uptimekuma_autokuma.1.8zmgere8fstc@qa-docker-4    | WARN [autokuma::sync] Encountered error during sync: Error in the hyper legacy client: client error (Connect)
uptimekuma_autokuma.1.8zmgere8fstc@qa-docker-4    | WARN [kuma_client::util] Using DOCKER_HOST=unix://tcp://qa-docker-1.transnomis.com:2375
uptimekuma_autokuma.1.8zmgere8fstc@qa-docker-4    | WARN [autokuma::sync] Encountered error during sync: Error in the hyper legacy client: client error (Connect)
uptimekuma_autokuma.1.8zmgere8fstc@qa-docker-4    | WARN [kuma_client::util] Using DOCKER_HOST=unix://tcp://qa-docker-1.transnomis.com:2375
uptimekuma_autokuma.1.8zmgere8fstc@qa-docker-4    | WARN [autokuma::sync] Encountered error during sync: Error in the hyper legacy client: client error (Connect)

@arhue
Copy link

arhue commented Aug 8, 2024

@andyloree Commit from master now fixed the issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants