Docker networking concept and implementation OMV8

  • Hi, almost complete newby here :) I have been playing with OMV8 and Docker for a couple of weeks now and I have got to grips with the concepts and actually have a few containers up and working.

    ddclient, embyserver, nginx-proxy-manager, profilarr, radarr, sonarr, sabnzbd. All are working OK but I know I need to do something about getting the containers to talk to each other properly.


    Currently I'm using external network addresses just to get it working but it's not optimal.


    I need to setup the internal networking but I'm at a bit of a loss. I know that for instance nginx and emby need to be in the same internal network and also that I have to define them in the YAML files. A simple step by step with the correct terminology would be very helpful :) I have read a few guides so sort of know where I'm going but I don't want to break what I have achieved so far with guesses.

    Also what are Host, Bridge and Null on the network settings?

  • I had this type of problem with containers.
    Sadly its either ther own portforwarded network or host is ideal.

    Host network means, the network card is the same as the OMV, like if you omv has a private ipv4 like 192.168.1.1 your application like qbittorent also reached by this ip 192.168.1.1. (example OMV dashboard reached by 192.168.1.1:80 qbittorent web interface reachead by 192.168.1.1:8080
    I use host network because i dont need port forward and UPnP is working with it so my qbittorent (or any container) can open a port themself, and get a public ipv6 address.
    So in this cause your containerr works like a runing native application on OMV, get the same ip addresses. no need internal port forward (dupble NAT).


    Edit

    macvlan should be like ven you create a virtula machine and it shows up like a different device in the network with different IP addresess. But i had some limitation with it so i sticked with host network setting.


    more details here:
    https://docs.docker.com/engine/network

    bridgeThe default network driver.
    hostRemove network isolation between the container and the Docker host.
    noneCompletely isolate a container from the host and other containers.
    overlaySwarm Overlay networks connect multiple Docker daemons together.
    ipvlanConnect containers to external VLANs.
    macvlanContainers appear as devices on the host's network.
  • My specific problem at the moment is that the containers I need to talk to each other are on different networks and I'm not sure how to change them.


    embyserver is on host and NGINX is on nginx-proxy-manager_default so I could change NGINX to be host but I actually don't know how to do this in the yaml file.


    I've been doing some more reading and as I understand it the bridge network is probably what I need as all containers in a bridge network get an internal address in the 172.0.0.0 range. Again i'm not sure and also can't figure out how to add emby to the bridge network, or all of the containers to the host network.

  • Again i'm not sure and also can't figure out how to add emby to the bridge network, or all of the containers to the host network.

    Have you tried using network_mode: statements?

    --
    Google is your friend and Bob's your uncle!


    A backup strategy is worthless unless you have a verified to work by testing restore strategy.


    OMV AMD64 7.x on headless Chenbro NR12000 1U Intel Xeon CPU E3-1230 V2 @ 3.30GHz 32GB ECC RAM.

    OMV AMD64 8.x on headless Tyan Thunder SX GT86C-B5630 1U Server with Intel Xeon Silver 4110 CPU @ 2.10GHz & 32GB DDR4 ECC RAM.

  • all of the containers to the host network.

    simple, if you want to add a container to the host network you just add this line to the composse file(YAML):

    network_mode: "host"

    Edit:
    Watch out for port conflicts, you may need to declare the ports manually to YAML file to avoid port conflicts if containers using the same port as others

    like(qbittorrent webport):

    environment:

    - WEBUI_PORT=2080

  • I was so close to getting there :)

    I'm not sure I want to add everything to the host network. One of the main reasons for me to make these changes is that the machine will be in my sons house and will not have a static IP. I already have tailscale setup so I won't lose control if his router is reset. I need to use internal addresses so that Sonarr and Sabnzbd can talk to each other.


    I have been doing a bit more reading and I think I should be adding the containers that need to talk to each other to the same network and that it should be a bridge network and I assume that I can use the default bridge network already in OMV? Is this correct?


    Assuming that it is correct further reading begs this question; Should I create a new bridge network for each "community" of apps that need to talk to each other such as sonarr, radarr and sabnzbd so that I could have multiple instances of the same app (such as sonarr) without network issues?


    I think I may have written that a bit wrong as I've just checked and all the apps are in their own bridge networks so maybe it should be sonarr should be in the sonarr, radarr & sabnzbd networks and the same for radarr and sabnzbd??


    Sorry for all the waffle :( but I was never that good at networking before moving from Windows to Linux so I like to be as sure as I can be.

  • It looks like I have found the solution or at least the start of it. The main issue was that NGINX needed an internal IP or hostname to forward to as I was using the external LAN address which of course could change if the router was reset.


    As Emby was set to host I set NGINX to host and used the inspect tool in services/compose/services to find the ip address and hostname of Emby. There isn't one :(


    So the next thing I tried was resetting NGINX to default and changing Emby to nginx-proxy-manager_default instead of host. Then when I checked using the inspect tool in services/compose/services Emby had a 172 adress and a hostname of embyserver ^^


    I then went to NGINX proxy Manager and changed the destination to be http://embyserver:8096 and it all worked perfectly :D

    Now if OMV gets a different IP address the forwarding should still work. I'll have to work out a way of testing that but I'm quietly confident.

    The next step is to create my own bridge network as apparentley the default one is not as good as a custom one and I don't really want to use the nginx-proxy-manager_default.


    Thanks gderf and Rchard22 for pointing me to the network_mode: line in the yaml as that made all that I'd read fall into place :thumbup:

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!