polkaned / dockerfiles

MIT License
110 stars 54 forks source link

Cannot get express vpn to connect #60

Open MarkStokes-outlook opened 1 week ago

MarkStokes-outlook commented 1 week ago

I have deployed the docker container as detailed, but it will not connect to ExpressVPN unless I add network_mode: host. But doing that means I cannot publish the ports I want for the services behind it.

It seems that, as defined, the container has no internet connection to be able to reach expressvpn, unless I add host networking.

Any suggestions?

#version "3.9"

networks:
  default:
    ipam:
      driver: default

########################### EXTENSION FIELDS

# Keys common to some of the dependent services/apps
x-common-keys-apps: &common-keys-apps
  environment:
    - TZ=$TZ
  security_opt:
    - no-new-privileges:true
  restart: unless-stopped

########################### SERVICES
services:
  expressvpn:
    image: polkaned/expressvpn
    container_name: expressvpn
    hostname: expressvpn
#    network_mode: host
    environment:
      - ACTIVATION_CODE=**************************
    cap_add:
      - NET_ADMIN
    devices:
      - "/dev/net/tun:/dev/net/tun"
    privileged: true
    tty: true
    volumes:
      - $DOCKERDIR/appdata/expressvpn/data/resolve.conf:/etc/resolve.conf
    ports:
      # Jackett
      - 9001:9001
      # Sonarr port
      - 9002:9002
      # Radarr port
      - 9003:9003
      # Radarr4K
      - 9004:9004
    command: /bin/bash
    restart: unless-stopped

  ############################  Jackett - Tracker Aggregator
  jackett:
    <<: *common-keys-apps
    image: ghcr.io/linuxserver/jackett
    container_name: Jackett
    depends_on:
      - expressvpn
    network_mode: service:expressvpn
#    ports:
#      - "9001:9001"
    volumes:
      - $DOCKERDIR/appdata/jackett/config:/config
      - $DOCKERDIR/appdata/expressvpn/data/resolve.conf:/etc/resolve.conf
    environment:
      - PUID=$PUID_Plex
      - PGID=$PGID_Plex
MarkStokes-outlook commented 1 week ago

Slight update. I believe it is down to the DNS settings in my Docker network.

MarkStokes-outlook commented 6 days ago

So, I have the expressvpn container connected and can ping www.google.com.

But... my jackett contain can ping an ip address, but not perform a DNS search.

The /etc/resolv.conf files are exactly the same on both containers.

#version "3.9"

networks:
  stoked_net:
    driver: bridge
    ipam:
      config:
        - subnet: 172.28.0.0/24
          gateway: 172.28.0.1

########################### EXTENSION FIELDS
# Helps eliminate repetition of sections
# More Info on how to use this: https://github.com/htpcBeginner/docker-traefik/pull/228

# Common environment values
x-common-keys-core: &common-keys-core
  environment:
    TZ: $TZ
  security_opt:
    - no-new-privileges:true
  restart: always

# Keys common to some of the dependent services/apps
x-common-keys-apps: &common-keys-apps
  environment:
    - TZ=$TZ
#  security_opt:
#    - no-new-privileges:true
  restart: unless-stopped

########################### SERVICES
services:

  expressvpn:
    image: polkaned/expressvpn
    container_name: expressvpn
    environment:
      - ACTIVATION_CODE=********************
    cap_add:
      - NET_ADMIN
    devices:
      - "/dev/net/tun:/dev/net/tun"
    privileged: true
    tty: true
    volumes:
      - $DOCKERDIR/appdata/expressvpn/data/resolv.conf:/etc/resolv.conf:rw
    networks:
      stoked_net:
        ipv4_address: 172.28.0.8
    ports:
      - 9001:9001 # Jackett
      - 9002:9002 # Sonarr
      - 9003:9003 # Radarr
      - 9004:9004 # Radarr4K
    command: /bin/bash
    restart: unless-stopped

  ############################  Jackett - Tracker Aggregator
  jackett:
    <<: *common-keys-apps
    image: ghcr.io/linuxserver/jackett
    container_name: jackett
    depends_on:
      - expressvpn
    network_mode: service:expressvpn
    privileged: true
    tty: true
#    ports:
#      - "9001:9001"
    volumes:
      - $DOCKERDIR/appdata/jackett/config:/config:rw
      - $DOCKERDIR/appdata/expressvpn/data/resolv.conf:/etc/resolv.conf:ro
    environment:
      - PUID=$PUID_Plex
      - PGID=$PGID_Plex
    command: /bin/bash
polkaned commented 2 days ago

You should take a look at https://github.com/polkaned/dockerfiles/issues/55#issuecomment-1859262276