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

Can't connect to container using network_mode: "service:gluetun" #186

Open
chrisbanes opened this issue Feb 1, 2025 · 1 comment
Open

Comments

@chrisbanes
Copy link

Describe the bug

I use multiple Docker Compose files. In the first is tsdproxy using a network called tailscale.

services:
  tsdproxy:
    image: almeidapaulopt/tsdproxy:latest
    container_name: tsdproxy
    networks:
      - tailscale
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /foo:/data
      - /bar:/config
    restart: unless-stopped
    ports:
      - "8080:8080"

networks:
  tailscale:
    external: true

In the second I use gluetun, to allow services to connect outwards over a VPN:

services:
  vpn:
    image: qmcgaw/gluetun
    container_name: vpn
    cap_add:
      - NET_ADMIN
    networks:
      vpn:
      tailscale:
    sysctls:
      - net.ipv4.ip_forward=1
      - net.ipv6.conf.all.forwarding=1
    restart: unless-stopped
    devices:
      - /dev/net/tun:/dev/net/tun
    ports:
      - 9696:9696 # prowlarr
    volumes:
      - /foo:/gluetun

  prowlarr:
    container_name: prowlarr
    image: lscr.io/linuxserver/prowlarr:latest
    network_mode: "service:vpn"
    labels:
      tsdproxy.enable: "true"
      tsdproxy.name: "prowlarr"
      tsdproxy.container_port: 9696

networks:
  tailscale:
    external: true

Unfortunately I'm not able to connect to the any of the containers using network_mode: "service:vpn". Using a Tailscale sidecar has been working fine for me previously.

Send config
The tsdproxy.yaml is very basic:

defaultproxyprovider: default
docker:
  local:
    host: unix:///var/run/docker.sock
tailscale:
  providers:
    default:
      authKey: "foo"
  datadir: /data/
http:
  hostname: 0.0.0.0
  port: 8080
log:
  level: trace
  json: false
proxyaccesslog: true

Logs

On tsdproxy startup:

9:49AM DBG trying to connect to internal port container=/deluge docker=local hostname=172.31.0.1 module=proxymanager port=58946
9:49AM DBG Error connecting to internal port error="no valid target found for internal ports " container=/prowlarr docker=local module=proxymanager
9:49AM DBG trying to connect to internal port container=/prowlarr docker=local hostname=172.31.0.1 module=proxymanager port=9696

When trying to connect:

9:50AM ERR error host=prowlarr.foo-bar.ts.net method=GET module=proxymanager proxyname=prowlarr status=502 url=/
@MadManMcIvor
Copy link

Having this same issue as well! Sadly nothing to add, just wanted to follow the issue.

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

2 participants