Jump to content

Understanding custom w/ docker


Recommended Posts

I'm hoping this is the right forum as the question references docker containers, but isn't about one specific one.

 

I'm failing to understand how custom networks work (and frankly a lot of networking generally), and what I want where.

 

My initial setup of Unraid was primarily for Emby and Plex, following the guidance I was reading both went on a custom network along with SWAG for reverse proxy. After that most of my uses didn't need anything else configured.

 

As it is now I have a few containers in the queue to finish setting up, and I'm really not sure best practice. 

 

I'm looking at playing with HomeAssistant, Nextcloud, Scrypted, FreePBX, MariaDB,  and potentially lancache. I don't have the foggiest what should be going on an br0, bridge, host, or a custom network. I'm really hoping for an ELI5, I've researched, but I'm still getting a bit hungup.

Link to comment

I would recommend reading this post:

and watching this video on the different docker networks:


Your nextcloud should be on a custom to set it to a static ip on your lan network to guranteee ports opened for its use and access to portforwarding for interent use.
 

Maria DB is ok to have as host your unraid IP will be the mysql for nextcloud.

not familiar with docker scrypted/freepbx.


I'm not seeing a reason for you to use macvlan here. ipvlan would work just as well. Just note that ipvlan shares your br0 (eth0) mac addresss for all dockers and access. there have been issues with rotuers before on how netowrk is handeld. Otherwise I would recommend a macvlan setup to give each docekr its own mac address as well.

  • Like 1
Link to comment
22 hours ago, bmartino1 said:

I would recommend reading this post:

and watching this video on the different docker networks:


Your nextcloud should be on a custom to set it to a static ip on your lan network to guranteee ports opened for its use and access to portforwarding for interent use.
 

Maria DB is ok to have as host your unraid IP will be the mysql for nextcloud.

not familiar with docker scrypted/freepbx.


I'm not seeing a reason for you to use macvlan here. ipvlan would work just as well. Just note that ipvlan shares your br0 (eth0) mac addresss for all dockers and access. there have been issues with rotuers before on how netowrk is handeld. Otherwise I would recommend a macvlan setup to give each docekr its own mac address as well.

Both great resources, thank you.

 

Would it be right to put Nextcloud/Emby/Plex/Swag on the same custom? I think that's part of my confusion, I get custom, but which custom eludes me.

 

Scrypted is a go-between, it takes in my camera streams (Unifi Protect) and sends them to home assistant. I'd guess that and homeassistant would both go on the same custom net then? Would that be all of the above on the same?

Link to comment
Posted (edited)

I don't know what you mean by custom network, then in this case... i will try to explain as networking can get confusing fast.

if you use custom br0/eth0/bond) you are using a ipvlan/macvlan docker that gets a static ip to you LAN connection
^to access the docker services, you would go to the custom ip you chose at each creation.
 

If you use docker create network command and make a docker bridge, this is also a custom network this bridge would tap/tun or use eth0/bond0/br0 depending on your unraid network settings.

You would go to the unraid host ip http://IPxxx.xxx.xxx.xxx:port### to access the docker service.

Some dockers need to be able to talk to each other, they would need to be in the same docker network.

Unraid Networking settings dictate this:
If you see and use custom br0 > you are most likely using a ipvlan docker network

If you see a bond0 you may be using macvlan/ipvlan depending on other unriad setting you chose.
If you see eth0 you have bonding and bridging off and are using a macvlan docker network for custom

I will always recommend a macvlan docker network for many compatibility reasons...

It is fine to use custom on all dockers and grant them local LAN access to your router DHCP to communicate to.

image.thumb.png.221c96468aabab6aa5b88c4a73bf45d4.png
It comes down to templates, docker communication and use case. As you can see with my docker selection. Some items are in their own docker network that I created.
Others are using unraids default macvlan setup and have a static IP they are using bond0
Others are using host and share ports but are direct connected to unraid and others are using the docker default bridge.

So when you make a docker, it's imports to choose the network:
image.thumb.png.95fc62f69cd72f3246c73fbf0a87dab9.png

 

image.png.d87f401a8835eb7035d3cb912b54c431.png

It is also important to not duplicate ports on the same network you chose. if you chose custom bond0/br0/eth0 you don't have to worry about ports as they are assigned to the ip addresses. Whereas if you have multiple default networks the ports can become in conflict as the ip to access them is unraids host ip, and we can't use the same port multiple time.

image.png.aaf7c5fe54840a3f9d64f49c8c367adb.png

 

host:  replaces unraids ports and if you replace critical port features with host you can brick the machine. (Normally for databases...)


bridge: Is the default network setting... this bridges the ports for the docker to unraids IP (if you have port conflicts it is recommended to move them to a custom or isolate them in there own networks.

netporbe: This is another default docker bridge I made for these dockers to isolate them to talk to each other in that network. Similar to bridge, it bridges the unriad ip to access them.

bond0: this is my unraid custom network docker. Unraid settings bridging off, bonding(mode 1) on then docker setting custom network macvlan and host access enable
^this is a macvlan setup that gives each docker its own random mac address and lan IP static to be used next to unraid over unraids interface. so if unriad is at 192.168.1.254 i can set a docker using this network to 192.168.1.x and to access that docker i go to 192.168.1.x

read about docker network types here: https://docs.docker.com/network/ and https://docs.docker.com/network/drivers/

Edited by bmartino1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...