Possible to get different IP for dockers?


Recommended Posts

Is it possible to have some of my docker containers get a different IP address on my local subnet?  I'm starting to run into some port conflicts with different apps I'm turning up in docker containers.

? Docker let's you reassign ports for containers pretty easily. Can you give us an example of where that isn't working for you?

Link to comment

Is it possible to have some of my docker containers get a different IP address on my local subnet?  I'm starting to run into some port conflicts with different apps I'm turning up in docker containers.

The usual way to deal with port conflicts is to remap the ports. That feature is already available in the built-in docker manager.
Link to comment

I had the same issue trying to run 2 Plex dockers. Inexplicably Plex hard codes port 32400 so a separate IP address is required for outside connectivity. There is a solution in Pipework, but it was too complicated for me to set up. According to this article other options may be in progress but aren't ready for prime time. The easy solution for me was to run the second Plex server in a VM.

Link to comment

Oh wow, never checked out support.

 

Hmm...

 

Gonna need to research this further. Eric and I were talking docker and vms and networking today.

 

In short, other than Plex, are there any other containers that you can't get around this using port mappings in docker?

Link to comment

Oh wow, never checked out support.

 

Hmm...

 

Gonna need to research this further. Eric and I were talking docker and vms and networking today.

 

In short, other than Plex, are there any other containers that you can't get around this using port mappings in docker?

 

There surely is PlexConnect that Needs both 80 and 443.

 

EDIT:  You can kind'of workaround it using the Reverse-Proxy docker (by smdion) and some advanced Apache config for the reverse settings.

 

ie: I can serve 80 and 443 to Apple TV from the Apache Reverse and forward to different Ports in PlexConnect with a specific SSL cert and still use same IP and Ports to serve different SSL Cert for my own Domain.  The trick is to identify the ServerName in the config (atv.plexconnect + trailers.apple.com for PlexConnect) or just no ServerName at all for my own domain.

Link to comment

Oh wow, never checked out support.

 

Hmm...

 

Gonna need to research this further. Eric and I were talking docker and vms and networking today.

 

In short, other than Plex, are there any other containers that you can't get around this using port mappings in docker?

 

There surely is PlexConnect that Needs both 80 and 443.

And you can't remap those ports inside the app itself?

Link to comment

Oh wow, never checked out support.

 

Hmm...

 

Gonna need to research this further. Eric and I were talking docker and vms and networking today.

 

In short, other than Plex, are there any other containers that you can't get around this using port mappings in docker?

 

There surely is PlexConnect that Needs both 80 and 443.

And you can't remap those ports inside the app itself?

And Plex connect requires host networking as opposed to bridge mode?

Link to comment

Oh wow, never checked out support.

 

Hmm...

 

Gonna need to research this further. Eric and I were talking docker and vms and networking today.

 

In short, other than Plex, are there any other containers that you can't get around this using port mappings in docker?

 

There surely is PlexConnect that Needs both 80 and 443.

And you can't remap those ports inside the app itself?

And Plex connect requires host networking as opposed to bridge mode?

 

Check my Edit on Previous post.  Yes you can remap in the PlexConnect config, but you absolutely need a proxy because Apple TV need to think it speak on Port 80&443.  Using the ReverseProxy, it work.  This is my ReverseProxy config.

 

<VirtualHost *:443>
        ServerName mydom.com
        ServerAlias mydom.com
        ServerAdmin [email protected]
        DocumentRoot /web
       
        SSLEngine on
        SSLProtocol all -SSLv2
        SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM
        SSLCertificateFile /config/ssl.crt
        SSLCertificateKeyFile /config/private-decrypt-ssl.key
        SSLCertificateChainFile /config/sub.class1.server.ca.pem
        
        #<Location />
        #		ProxyPreserveHost On
        #        ProxyPass http://192.168.2.6:8000/
        #        ProxyPassReverse http://192.168.2.6:8000/
        #</Location>

        
        <Location /movies>
                ProxyPass http://192.168.2.6:5050/movies
                ProxyPassReverse http://192.168.2.6:5050/movies
                AuthUserFile /config/.htpasswd
                AuthType Basic
                AuthName "CouchPotato - Proxy"
                Require user admin
        </Location>
         
        <Location /tv>
                ProxyPass http://192.168.2.6:8989/tv
                ProxyPassReverse http://192.168.2.6:8989/tv
                AuthUserFile /config/.htpasswd
                AuthType Basic
                AuthName "Sonarr - Proxy"
                Require user admin
        </Location>

        <Location /download>
                ProxyPass http://192.168.2.6:6789
                ProxyPassReverse http://192.168.2.6:6789
                AuthUserFile /config/.htpasswd
                AuthType Basic
                AuthName "NZBGet - Proxy"
                Require user admin
        </Location>
        
        <Location /mediabrowser>
                ProxyPass http://192.168.2.6:8096/mediabrowser
                ProxyPassReverse http://192.168.2.6:8096/mediabrowser
        </Location>

		<Location /owncloud>
                ProxyPass https://192.168.2.6:8000/owncloud
                ProxyPassReverse https://192.168.2.6:8000/owncloud
                AuthUserFile /config/.htpasswd
                AuthType Basic
                AuthName "OwnCloud - Proxy"
                Require user admin
        </Location>
        
        <Location /unifi>
                ProxyPass https://192.168.2.6:8443/unifi
                ProxyPassReverse https://192.168.2.6:8443/unifi
         </Location>    
</VirtualHost>

<VirtualHost *:443>
	SSLEngine on
	SSLProtocol -ALL +SSLv3 +TLSv1
        SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:!LOW::!SSLv2:!EXPORT
	SSLCertificateFile /plexconnect/trailers.cer
	SSLCertificateKeyFile /plexconnect/trailers.key
	ProxyPreserveHost On
	ProxyPass / http://192.168.2.6:82/
	ProxyPassReverse / http://192.168.2.6:82/
	ServerName trailers.apple.com
</VirtualHost>

<VirtualHost *:443>
	SSLEngine on
	SSLProtocol -ALL +SSLv3 +TLSv1
        SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:!LOW::!SSLv2:!EXPORT
	SSLCertificateFile /plexconnect/trailers.cer
	SSLCertificateKeyFile /plexconnect/trailers.key
	ProxyPreserveHost On
	ProxyPass / http://192.168.2.6:82/
	ProxyPassReverse / http://192.168.2.6:82/
	ServerName atv.plexconnect
</VirtualHost>

<VirtualHost *:80>
        ServerName mydom.com
        ServerAlias mydom.com
        ServerAdmin [email protected]
        DocumentRoot /web
</VirtualHost>

<VirtualHost *:80>
	ServerName atv.plexconnect
	ProxyPreserveHost On
	ProxyPass / http://192.168.2.6:82/
	ProxyPassReverse / http://192.168.2.6:82/
</VirtualHost>

  <VirtualHost *:80>
	ServerName trailers.apple.com
	ProxyPreserveHost On
	ProxyPass / http://192.168.2.6:82/
	ProxyPassReverse / http://192.168.2.6:82/
</VirtualHost>

Link to comment

Oh wow, never checked out support.

 

Hmm...

 

Gonna need to research this further. Eric and I were talking docker and vms and networking today.

 

In short, other than Plex, are there any other containers that you can't get around this using port mappings in docker?

 

There surely is PlexConnect that Needs both 80 and 443.

And you can't remap those ports inside the app itself?

And Plex connect requires host networking as opposed to bridge mode?

 

It could use different  mode but then you have to find a way to remap the other network services that plex uses internally. I forget which it is, maybe it was network discover. But it's mentioned in one of the Docker files I was looking at for plex. I haven't had a chance to experiment in my own docker with this to see if I could keep it to the simpler mode.

Link to comment

Oh wow, never checked out support.

 

Hmm...

 

Gonna need to research this further. Eric and I were talking docker and vms and networking today.

 

In short, other than Plex, are there any other containers that you can't get around this using port mappings in docker?

 

There surely is PlexConnect that Needs both 80 and 443.

And you can't remap those ports inside the app itself?

And Plex connect requires host networking as opposed to bridge mode?

 

It could use different  mode but then you have to find a way to remap the other network services that plex uses internally. I forget which it is, maybe it was network discover. But it's mentioned in one of the Docker files I was looking at for plex. I haven't had a chance to experiment in my own docker with this to see if I could keep it to the simpler mode.

 

I'm 99% sure plex connect could do bridged, but it does need 80/443 or a working reverse proxy config.

Link to comment

Also.. is changing the unRAID WebUI port something we want to add into the WebUI?

 

I don't know if that'll ever be supported with emhttp since that process cannot be restarted but you can change the webgui port today by adding a -p 8000 (if say you wanted to move it from the default port 80 to port 8000) to the emhttp line in /boot/config/go:

#!/bin/bash
# Start the Management Utility
/usr/local/sbin/emhttp -p 8000 &

 

Then just reboot unRAID to have that port change go in to effect.

Link to comment

Also.. is changing the unRAID WebUI port something we want to add into the WebUI?

 

I don't know if that'll ever be supported with emhttp since that process cannot be restarted but you can change the webgui port today by adding a -p 8000 (if say you wanted to move it from the default port 80 to port 8000) to the emhttp line in /boot/config/go:

#!/bin/bash
# Start the Management Utility
/usr/local/sbin/emhttp -p 8000 &

 

Then just reboot unRAID to have that port change go in to effect.

 

Yeah :)  I was just thinking with a few dockers running on port 80 it may be easier for some users to have it in the WebUI.

Link to comment
  • 3 months later...

off topic but not to off

 

So no one here runs more that one nic on their unraid system?

 

I am stuck with two dual port intel PCI gbit cards because they would not work on correctly with pfSense box and  i thought about installing them on the unraid and see what kind of monkey business i could get into.

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.