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.

Docker publish/expose ports properly

Featured Replies

Hi, I'm using Unraid 6.6.7 and having some issues when trying to publish/expose docker ports.

 

In my example I want to publish both UDP ports 27015 and 34197.
Unraid will display that the ports are published, but I can't access them.

 

Here is the command that will be executed:

root@localhost:# /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name='factorio' --net='br0' --ip='192.168.2.20' -e TZ="Europe/Berlin" -e HOST_OS="Unraid" -e 'UDP_PORT_27015'='27015' -e 'UDP_PORT_34197'='34197' -v '/mnt/user/appdata/factorio':'/factorio':'rw' 'dtandersen/factorio' 

As you can see Unraid is using -e 'UDP_PORT_34197'='34197' instead of -p 34197:34197

 

I've seen other installations that were using the "-p" instead of the "-e" argument.
Now I'm asking how can I configure that Unraid will use the "-p" argument?

 

Thanks in advance!

25 minutes ago, theLine said:

Hi, I'm using Unraid 6.6.7 and having some issues when trying to publish/expose docker ports.

 

In my example I want to publish both UDP ports 27015 and 34197.
Unraid will display that the ports are published, but I can't access them.

 

Here is the command that will be executed:


root@localhost:# /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name='factorio' --net='br0' --ip='192.168.2.20' -e TZ="Europe/Berlin" -e HOST_OS="Unraid" -e 'UDP_PORT_27015'='27015' -e 'UDP_PORT_34197'='34197' -v '/mnt/user/appdata/factorio':'/factorio':'rw' 'dtandersen/factorio' 

As you can see Unraid is using -e 'UDP_PORT_34197'='34197' instead of -p 34197:34197

 

I've seen other installations that were using the "-p" instead of the "-e" argument.
Now I'm asking how can I configure that Unraid will use the "-p" argument?

 

Thanks in advance!

I think you should show a screenshot of the docker settings page for that container.    The -e option suggests you have set up environment variable mappingrather than port mapping.

  • Author

Here's a screenshot of my container configuration

The weird this is, that all of my docker containers (e.g. Plex) are using the "-e" option... 🤔

unraid.png

The reason is that you have set it to use a bridge and assigning an IP. Then the container port will be used and you can't publish any ports. It's the same as using host networking. Unraid then switch the -p to -e automatically. Don't know why they did that instead of just removing it from the run command though....

19 hours ago, saarg said:

Don't know why they did that instead of just removing it from the run command though....

This is done to make assignments visible, see "Show Docker allocations"

  • Author

So there's no way to remap ports when using a custom IP address?

  • Author

Basically you're right, and in this example there's no need for it.

 

But I'm using NginxProxyManager which uses 8080 and 4443 respectively. For external access I can use port-forwarding in my firewall to remap 8080 to 80 and 4443 to 443.

Unfortunately I can't use the local IP addresses then.

 

P.S.: I'm using NginxProxyManager  just for ease of use.

Maybe I have to use a "proper" nginx/Let's Encrypt docker container for that... 

29 minutes ago, theLine said:

For external access I can use port-forwarding in my firewall to remap 8080 to 80 and 4443 to 443.

I don't see why not.

You can still use external ports 8080 and 8443 and map them internally to ports 80/443 and the associated IP address of the container.

1 hour ago, bonienl said:

This is done to make assignments visible, see "Show Docker allocations"

But they are not valid and is just there to confuse as far as I see it. It's still in the template, visible, even if it's removed from the run command.

12 hours ago, saarg said:

But they are not valid and is just there to confuse as far as I see it. It's still in the template, visible, even if it's removed from the run command.

They indicate which port(s) are used by the container, I don't see anything confusing about that.

 

The containers list and resources are retrieved from reading docker directly to ensure their 'validity', the templates are only used for configuration.

 

12 hours ago, bonienl said:

They indicate which port(s) are used by the container, I don't see anything confusing about that.

 

The containers list and resources are retrieved from reading docker directly to ensure their 'validity', the templates are only used for configuration.

 

If you are readin docker directly for ports, why do you need to add it as a variable to the run command? When it's in a custom bridge or host, it's only the container port that is anything to care about, and that you read from docker directly you say.

 

It's confusing for people that doesn't know how the internals of unraid work when they see that the ports are suddenly set as variables, when they expect a port mapping.

Archived

This topic is now archived and is closed to further replies.

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.