Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Attach multiple docker networks to docker container in UI

Featured Replies

I run a reverse proxy to access my applications running in docker containers.

For multiple reasons, I use several different custom docker networks.

My reverse proxy needs to be in every one of them. Right now I

  1. stop the container
  2. switch to the command line
  3. add every network to the container
  4. start the container

I need to do this every time the container gets updated.

 

It would be very useful to add multiple docker networks via UI that get attached every time the container starts.

  • 2 weeks later...

This is exactly what I wanted to request as well. Glad I've serched first.

 

I wanted to run a reverse proxy in my local network and its better to have it in at least 2 networks: in a custom docker network and in my local network (so I can access it without using the Unraid's IP and be able to use the 443 an 80 ports)

  • 1 month later...

I would like to see some improvements to the UI for this, but there IS currently a simpler way than you mentioned:

 

1. Edit the container

2. Enable “Advanced View”

3. Add the following to “Post Arguments” (replacing the appropriate values):


```

&& docker network connect <your network name> <your container name>
```

 

This will persist across updates. 

 

  • 1 month later...

+1

  • 2 months later...

Please +1

  • 4 months later...

+1

  • 3 months later...

+1

  • 4 months later...

+1 ❤️

  • 3 weeks later...

+1

+1

  • 1 month later...

+1

+1

+1

  • 2 weeks later...
Brandon Martino - Personal Site
No image preview

Guide-DockerNetworks

Brandon Martino - Personal Site

image.pngimage.png

...

Edited by bmartino1
read and learn the docker docs.

use compose file and mange all the newtorks in 1 file....

5 minutes ago, bmartino1 said:

use compose file and mange all the newtorks in 1 file....

Yes, there are workarounds:

  • You can use Docker Compose to manage the whole docker stack

  • You can run docker network connect <network-name> <container-name> manually

  • You can add && docker network connect <network-name> <container-name> in Advanced View -> Post Arguments

All of them have problems. Docker Compose is not officially supported. There is a plugin that installs docker-compose, but it has no UI support, so containers must always be managed via the shell. Running docker network connect manually does not persist across container restarts.

The only somewhat usable workaround is using Post Arguments but it has it's own problems:

  • The network must have been previously created via the shell, there is no user interface to manage docker networks

  • It's hidden under Advanced View

  • It wasn't designed to run extra commands after the docker run ... <image>. It's purpose is to allow adding arguments after <image> , which are passed to the application running inside the docker container. I had a look at the code and it works by sheer luck due to how the docker run ... command is constructed and executed using popen which runs the command in a sub-shell. I'm not sure if "Post Arguments" can be supplied from a template file, if that's the case that is a whole other can of worms from a security perspective because that would allow shell injection on the host machine (if you were to use an untrusted application template).

  • It's a single line input field. For containers that connect to multiple networks like a reverse proxy, it hard to edit. One minor improvement would be to change this input field to a multi-line input <textarea>), preferably resizable.

    image.pngimage.png

While the shell and workarounds exist, an official UI would be useful to manage Docker networks and allow containers to attach to multiple networks.

Edited by mihaiblidaru

another trick is to make a internal docker network that user define yes will save and keep .... no start stop disonc cno cli stuff...

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...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.