Hi all,
I am new to Docker and Portainer and I am having an issue with my Gluetun stack (Gluetun, NATMAP, Jackett, qBittorrent), I can get it setup and running but if I try to use the Recreate button inside Portainer to rebuild the container I get the following error message.
“Failed recreating container: Create container error: Error response from daemon: conflicting options: hostname and the network mode”
I am lost as to why I get this error as everything in the stack works correctly, the vpn connection and network pass-through all work, the only issue is recreating the container, note that I am creating the stack using Docker Compose, if I try to do it from inside Portainer it throws the above error message but the stack is still created correctly. I have tried removing the hostname from the compose file, and setting one specifically (vpn), I get the same result.
Anyone else had this issue, any advise?
Here is my compose file.
services:
gluetun:
image: qmcgaw/gluetun
container_name: gluetun
# line above must be uncommented to allow external containers to connect.
# See https://github.com/qdm12/gluetun-wiki/blob/main/setup/connect-a-container-to-gluetun.md#external-container-to-gluetun
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun:/dev/net/tun
ports:
- 9117:9117 # Jackett
- 8080:8080 # qBittorrent
- 8888:8888/tcp # HTTP proxy
- 8388:8388/tcp # Shadowsocks
- 8388:8388/udp # Shadowsocks
volumes:
- /home/uhax/Docker/Gluetun:/gluetun
environment:
# See https://github.com/qdm12/gluetun-wiki/tree/main/setup#setup
- VPN_SERVICE_PROVIDER=protonvpn
# - VPN_TYPE=wireguard
# OpenVPN:
- OPENVPN_USER=
- OPENVPN_PASSWORD=
- SERVER_COUNTRIES=New Zealand
- PORT_FORWARD_ONLY=on
# Wireguard:
# - WIREGUARD_PRIVATE_KEY=
# - WIREGUARD_ADDRESSES=
# Timezone for accurate log times
- TZ=Pacific/Auckland
# Server list updater
# See https://github.com/qdm12/gluetun-wiki/blob/main/setup/servers.md#update-the-vpn-servers-list
- UPDATER_PERIOD=24h
- PORT_FORWARD_ONLY=on
# - VPN_PORT_FORWARDING_PROVIDER=protonvpn
restart: unless-stopped
qbittorrent:
image: lscr.io/linuxserver/qbittorrent:latest
container_name: qbittorrent
environment:
- PUID=1000
- PGID=1000
- TZ=Pacific/Auckland
volumes:
- /home/uhax/Docker/qBittorrent/appdata:/config
- /home/uhax/Torrents:/downloads #optional
- /home/uhax/Downloads:/blackhole #optional
restart: unless-stopped
network_mode: "service:gluetun"
depends_on:
gluetun:
condition: service_healthy
qbittorrent-natmap:
# https://github.com/soxfor/qbittorrent-natmap
image: ghcr.io/soxfor/qbittorrent-natmap:latest
container_name: qbittorrent-natmap
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- TZ=Pacific/Auckland
- QBITTORRENT_SERVER=localhost
- QBITTORRENT_PORT=8080
- QBITTORRENT_USER=
- QBITTORRENT_PASS=
# - VPN_GATEWAY=
# - VPN_CT_NAME=gluetun
# - VPN_IF_NAME=tun0
# - CHECK_INTERVAL=300
# - NAT_LEASE_LIFETIME=300
restart: unless-stopped
network_mode: "service:gluetun"
depends_on:
gluetun:
condition: service_healthy
jackett:
image: lscr.io/linuxserver/jackett:latest
container_name: jackett
environment:
- PUID=1000
- PGID=1000
- TZ=Pacific/Auckland
- AUTO_UPDATE=true #optional
volumes:
- /home/uhax/Docker/Jackett/data:/config
- /home/uhax/Docker/Jackett/blackhole:/downloads
restart: unless-stopped
network_mode: "service:gluetun"
depends_on:
gluetun:
condition: service_healthy