首页 > 解决方案 > 连接到 NordVPN Docker 容器时在 Docker 容器中挂载 NFS 卷

问题描述

我目前正在尝试弄清楚如何正确地将我的 NFS 共享挂载到我的 Docker 容器:radar、sonarr、sabnzbdjdownloader。容器通过 vpn 服务容器“nordvpn”路由所有流量。

当我试图打开 NFS 文件夹时,它们只是空的。所以我猜这个坐骑不能正常工作。
我还尝试仅将没有 nordvpn 容器的 sabnzbd 服务连接到 NFS 共享。这对我也不起作用。

我的撰写文件:


version: "3"
services:
  vpn:
    image: bubuntux/nordvpn:3.7.4  # olderversion caused by a connection error 
    container_name: nordvpn
    network_mode: bridge        # Required
    cap_add:
      - NET_ADMIN               # Required
      - SYS_MODULE              # Required for TECHNOLOGY=NordLynx
    sysctls:
      - net.ipv4.conf.all.rp_filter=2
    devices:
      - /dev/net/tun            # Required
    environment:                # Review https://github.com/bubuntux/nordvpn#environment-variables
      - USER=xxx     # Required
      - "PASS=xxx"         # Required
      - CONNECT=Netherlands
      - TECHNOLOGY=NordLynx
      - NETWORK=192.168.2.0/24 
      - TZ=Europe/Berlin
    ports:
      - 8080:8080   # sabnzbd
      - 7878:7878   # radarr
      - 8989:8989   # sonarr
      - 5800:5800   # jdownloader
      

  sabnzbd:
    image: linuxserver/sabnzbd
    container_name: sabnzbd
    network_mode: service:vpn
    depends_on:
      - vpn
    volumes:
    #  - "./config/sabnzbd:/config" # sab config directory
      - "/192.168.2.222/mnt/array1/Share/Complete_Down:/complete_downloads" # completed directory for downloads. this contains the category directories
      - "/192.168.2.222/mnt/array1/Share/Temp_Down:/temp_downloads" # "temp" directory for downloads
      - "/192.168.2.222/mnt/array1/Share:/storage/Share"
      - "/192.168.2.222/mnt/array1/xxx:/storage/Filme"
      - "/192.168.2.222/mnt/array1/xxx:/storage/Serien"
      - "/192.168.2.222/mnt/array1/xxx:/storage/Spiele"
    environment:
      TZ: Europe/Berlin
      PUID: 99 # set to UID of your user
      PGID: 99 # set to GID of your user

  radarr:
    image: linuxserver/radarr
    container_name: radarr
    network_mode: service:vpn
    depends_on:
      - vpn
    volumes:
    #  - "./config/radarr:/config" # config directory for radarr
      - "/192.168.2.222/mnt/array1/Share/Complete_Down:/complete_downloads" # completed downloads directory from sab
      - "/192.168.2.222/mnt/array1/xxx/storage/Filme/HD" # where radarr will copy your movies. add as many of these as you need
    environment:
      TZ: Europe/Berlin
      PUID: 99 # set this to the UID of your user
      PGID: 99 # set this to the GID of your user

  sonarr:
    image: linuxserver/sonarr
    container_name: sonarr
    network_mode: service:vpn
    depends_on:
      - vpn
    volumes:
    #  - "./config/sonarr:/config" # sonarr config dir
      - "/192.168.2.222/mnt/array1/Share/Complete_Down:/complete_downloads" # completed downloads directory 
      - "/192.168.2.222/mnt/array1/xxx:/storage/Serien"
    environment:
      TZ: Europe/Berlin
      PUID: 99 # set this to the UID of your user
      PGID: 99 # set this to the GID of your user


  #initialize jdownloader Docker Image 
  jdownloader-2:
    image: jlesage/jdownloader-2
    container_name: jdownloader
    network_mode: service:vpn
    depends_on:
      - vpn
    volumes:
      - "/docker/appdata/jdownloader-2:/config"
      - "/192.168.2.222/mnt/array1/Share/Complete_Down:/output"
      

我也试过这样

volumes: 
    share: 
     driver: local 
     driver_opts: 
     type: nfs 
     o: addr=192.168.2.222,rw 
     device: ":/mnt/array1/Share" 

有任何想法吗 ?

标签: dockervpnnfs

解决方案


推荐阅读