ethanpil Posted May 14, 2020 Share Posted May 14, 2020 Per the Docker documentation, it seems we can specify a hostname for the machine. https://docs.docker.com/config/containers/container-networking/ I am hoping we can give our dockers hostnames which might register with the system DNS. So we can type things like http://jellyfin.tower to access instead of remembering all of the IPs... Quote Link to comment
saarg Posted May 14, 2020 Share Posted May 14, 2020 You can already do this using the extra parameters field. Quote Link to comment
ethanpil Posted June 11, 2020 Author Share Posted June 11, 2020 On 5/14/2020 at 1:34 AM, saarg said: You can already do this using the extra parameters field. Can you point me in the right direction? Where can I read up on this? Quote Link to comment
saarg Posted June 11, 2020 Share Posted June 11, 2020 3 minutes ago, ethanpil said: Can you point me in the right direction? Where can I read up on this? There isn't much to read up on. Toggle to advance mode in the top right corner of the container template and the extra parameter field is visible. Then you can add whatever docker parameter you need. Quote Link to comment
Chezzy Posted November 25, 2020 Share Posted November 25, 2020 Did you get this working as I have tried the hostname etc and still can't access by hostname ? Quote Link to comment
DingHo Posted December 29, 2020 Share Posted December 29, 2020 I'm curious on this as well. I'd like to set it up with something like: plex.tower sonarr.tower pihole.tower Quote Link to comment
np226 Posted January 16, 2021 Share Posted January 16, 2021 Hi, I was wondering if anybody could help me? I have a container - linuxserver/unifi-controller and I have a manual IP assigned, I have hit advanced > extra parameters, have added --hostname unifi-ctrlr root@localhost:# /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name='unifi-controller' --net='br0' --ip='192.168.100.2' -e TZ="Australia/Sydney" -e HOST_OS="Unraid" -e 'UDP_PORT_3478'='3478' -e 'TCP_PORT_8080'='8080' -e 'TCP_PORT_8443'='8443' -e 'TCP_PORT_8880'='8880' -e 'TCP_PORT_8843'='8843' -e 'UDP_PORT_10001'='10001' -e 'PUID'='99' -e 'PGID'='100' -v '/mnt/user/appdata/unifi-controller':'/config':'rw' --hostname unifi-ctrlr 'linuxserver/unifi-controller' 2dcfd7d24e972ce44a0c44cf945e4685784659d778b54a613ce75886b444a9ac The command finished successfully! Anyway, the hostname doesn't appear to be assigned to the docker. Same thing for plex. Anyone have any ideas? Cheers Nik Quote Link to comment
amiskell Posted January 20, 2021 Share Posted January 20, 2021 Docker doesn't/won't do this natively because it doesn't run a DHCP client. Registering hostnames in DNS is a function of the DHCP protocol and since the docker containers don't run a DHCP client, it'll never register those things in DNS. The hostname parameter only allows you to specify the hostname of the container itself otherwise it uses the containers randomly assigned ID number as the hostname (it's useful if you have an application that requires a static hostname). Quote Link to comment
Energen Posted January 20, 2021 Share Posted January 20, 2021 I could be wrong here but I don't think that any setting, whether it is on the docker configuration or contained within Unraid somewhere, would have the effect that you want. Whatever you set on the docker would apply to it's network only, and whatever was set on Unraid would apply to it's network only. If that makes sense.. When you're on your computer you're resolving DNS through your router's dhcp/dns which isn't going to know anything about Unraid or docker containers. So from my point of view you only have 2 options... 1) Every computer you use would have to have [i][u]it's[/i][/u] hosts file changed to include the hostnames you want, or 2) Have a router capable of setting custom hostnames... not sure if this is even a thing.. And I mean... then.... you know.... you could always bookmark the sites in your browser......... and not have to think about it. Quote Link to comment
MiQUEL Posted February 18, 2021 Share Posted February 18, 2021 On 1/16/2021 at 11:46 AM, np226 said: Hi, I was wondering if anybody could help me? I have a container - linuxserver/unifi-controller and I have a manual IP assigned, I have hit advanced > extra parameters, have added --hostname unifi-ctrlr root@localhost:# /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name='unifi-controller' --net='br0' --ip='192.168.100.2' -e TZ="Australia/Sydney" -e HOST_OS="Unraid" -e 'UDP_PORT_3478'='3478' -e 'TCP_PORT_8080'='8080' -e 'TCP_PORT_8443'='8443' -e 'TCP_PORT_8880'='8880' -e 'TCP_PORT_8843'='8843' -e 'UDP_PORT_10001'='10001' -e 'PUID'='99' -e 'PGID'='100' -v '/mnt/user/appdata/unifi-controller':'/config':'rw' --hostname unifi-ctrlr 'linuxserver/unifi-controller' 2dcfd7d24e972ce44a0c44cf945e4685784659d778b54a613ce75886b444a9ac The command finished successfully! Anyway, the hostname doesn't appear to be assigned to the docker. Same thing for plex. Anyone have any ideas? Cheers Nik I've been using this feature in docker-compose files (without unraid) but here I cannot get it to work. One walk-thru has been to edit /etc/hosts and identify each container with it's ip like. root@Tower:~# cat /etc/hosts # Generated 127.0.0.1 Tower localhost 54.149.176.35 keys.lime-technology.com 172.20.0.11 mqtt 172.20.0.15 mariadb Is not perfect but works Quote Link to comment
tjb_altf4 Posted February 18, 2021 Share Posted February 18, 2021 14 minutes ago, MiQUEL said: I've been using this feature in docker-compose files (without unraid) but here I cannot get it to work. One walk-thru has been to edit /etc/hosts and identify each container with it's ip like. root@Tower:~# cat /etc/hosts # Generated 127.0.0.1 Tower localhost 54.149.176.35 keys.lime-technology.com 172.20.0.11 mqtt 172.20.0.15 mariadb Is not perfect but works Be aware with this method (and network config) that those docker IPs are subject to change. Quote Link to comment
MiQUEL Posted April 8, 2021 Share Posted April 8, 2021 not if they are defined in the appropiate input text when you configure it, right? Although i don't really like how dockers behave if you create it directly with the assistant. I dont see a way to control them as I used to do with docker-compose, I dont know any option like "depends_on". And I think this is a must in complex environment where you need to be sure that X Y and Z have to be running before start A and B containers. Quote Link to comment
itimpi Posted April 9, 2021 Share Posted April 9, 2021 3 hours ago, MiQUEL said: I dont know any option like "depends_on". And I think this is a must in complex environment where you need to be sure that X Y and Z have to be running before start A and B containers. You CAN control the order in which docker containers are started under unRaid by re-ordering them on the Docker tab and also set delays in the sequence to allow for initialisation of specific containers before continuing with loading further containers. I would have thought for most use cases this was sufficient? Quote Link to comment
IMTheNachoMan Posted October 2, 2021 Share Posted October 2, 2021 On 5/14/2020 at 4:34 AM, saarg said: You can already do this using the extra parameters field. Would you mind explaining how? Because I cannot find any `hostname` option in advanced. Quote Link to comment
Squid Posted October 2, 2021 Share Posted October 2, 2021 By adding the applicable entry to the Extra Parameters entry in Advanced View when editing the container https://docs.docker.com/config/containers/container-networking/#:~:text=. You can override the hostname using --hostname. Quote . You can override the hostname using --hostname. Quote Link to comment
IMTheNachoMan Posted October 2, 2021 Share Posted October 2, 2021 1 hour ago, Squid said: Advanced View Doh! I didn't even see that advanced view link in the top right corner. Thank you! Quote Link to comment
IMTheNachoMan Posted October 2, 2021 Share Posted October 2, 2021 Okay so I think I am missing something. The hostname is getting set but two Docker containers both using Bridge network can't resolve each other's hostnames. When I was using Docker Compose all I had to do was set the hostname and then another container could resolve the IP of that container using hostname. Is there a way to get this to work with unRaid? Quote Link to comment
Recommended Posts
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.