1activegeek

[SOLVED][6.4.1] Preserve User Defined Networks for Docker - not showing up

12 posts in this topic Last Reply

Recommended Posts

So I'm new to unRAID and it took a few looks around things to find the details in the help documentation for the Docker settings to find the new feature from @bonienl "Preserver User Defined Networks". First off thank you to him for this as I do like to use custom created networks. 

 

Description: When setting this option to YES, it is seeming to preserve the network through a reboot, but it is not making it available in the docker network type drop down as described. 

Help reads: 

Quote

Shows whether networks created outside of the GUI are removed or preserved for Docker. When preserved user defined networks become available in the Network type dropdown list of containers.

 

How to reproduce: Enable the setting under Settings > Docker > Advanced tab - Preserve User Defined Networks

 

Expected Results: Any custom created docker networks would now appear in the Network Type dropdown in the containers section.

 

Actual Results: Network Type dropdown in the containers section has no new entries matching the customer created networks.

Edited by 1activegeek

Share this post


Link to post

Coming to bump this topic from about a month ago. Haven't seen any responses. I'm hoping someone can help shed some light. I recently had to go through a cache upgrade, and in doing so I lost the configured docker networks. I was expecting this would have saved them, but to no avail as well. Happy to test and help resolve as this is an important feature that I do in fact utilize. 

Share this post


Link to post

It is working fine for me.

 

image.png.7b90fc4d78a2c183d04ac6d1551701f1.png

 

docker network create -d macvlan --subnet=192.168.1.0/24 --gateway=192.168.1.1 -o parent=eth1 my_network

image.png.5fcf3a2b82c0d595966a459064faf46a.png

 

Make sure that your own created networks do not conflict with the automatically created networks. A parent interface (here eth1) can only be used once!.

 

Share this post


Link to post

Thanks @bonienl for the followup. Perhaps this has something to do with the way the "custom" networks are being discovered then? Here is my Docker settings in UR:

5aa58cc9601f1_ScreenShot2018-03-11at4_08_27PM.thumb.png.97062f696fdda4afdd346dba21505dd2.png

 

But you will notice here, that I have another customer network named "bridge2":

5aa58d321525b_ScreenShot2018-03-11at4_09_57PM.png.d3ced68d31d933598c9c9090ebd8475c.png

 

But this custom network is not showing up:

5aa58d610b30b_ScreenShot2018-03-11at4_10_55PM.thumb.png.06b180cc478768efc30b3af8d294c83c.png

 

Perhaps I needed to elaborate on the custom network not being picked up here. ;o)

Share this post


Link to post
Posted (edited)
9 minutes ago, 1activegeek said:

Perhaps I needed to elaborate on the custom network not being picked up here. ;o)

 

The current implementation only looks for additional macvlan custom networks. You have a second custom bridge network which is not included.

 

And eth0 is not created because it has the same gateway as br1, which Docker doesn't allow. You either remove the gateway from eth0, or give it a unique value.

Edited by bonienl

Share this post


Link to post

Ahhh, ok that would explain it then. Anywhere you can point me to the code that looks for macvlan, so I can look at possible adaptation for bridge networks as well? Thankfully I only have the one, but would be nice to be able to have it save these custom networks as well. 

Share this post


Link to post

I am afraid it is not as simple as changing 1 line of code to include custom bridge networks. I recommend you use macvlan for all your custom networks.

Share this post


Link to post

Got it, I was thinking more about understanding the code that was used for presenting the data inside of unRAID. I figured weeding out individual bridge networks would be more difficult. Unfortunately, my use case wouldn't work as well using macvlan based networking. I'm using the bridge network to let docker do its normal networking for containers, but provide name resolution which the default network does not. If I switch to macvlan, I expose the containers to the local network which I do not want to do at all. 

Share this post


Link to post

If you absolutely need to use a custom bridge network, just pick None in the network dropdown, and add to "extra parameters" "--network bridge2"

Share this post


Link to post
Posted (edited)

Thanks ken-ji, that's what I'm doing right now, though I just leave it for bridge. The --net=bridge2 setting I use will override it anyway on creation. I just wish these additional networks could be saved. It shouldn't happen often, but I'd imagine things like OS updates in the future and possible upgrades to the docker core system could possibly wipe these out. Additionally if there is a loss then I would need to re-create them. It's not extremely difficult, just would be a nice to have. I'll mark this as resolved.  Whoops, I guess that's not an option here. Oh well. 

Edited by 1activegeek

Share this post


Link to post
15 hours ago, 1activegeek said:

I'll mark this as resolved.  Whoops, I guess that's not an option here. Oh well. 

It is, you edit the first post in the thread and change the title.

Share this post


Link to post

Aha! Thank you jonathanm! That helps. Wasn't aware I had to do it that way. All set now. 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


Copyright © 2005-2018 Lime Technology, Inc.
unRAID® is a registered trademark of Lime Technology, Inc.