Docker

For help and support with Universal Media Server
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply
Luthair
Posts: 2
Joined: Wed Oct 24, 2018 2:29 pm

Docker

Post by Luthair »

Is there any documentation on how to properly use the docker image?

My guess was that the /profile volume should point at a directory with a UMS.conf file, however by the logs it does not appear to be the case.

Code: Select all

WARN  03:50:30.497 [main] Can't load neither /root/.config/UMS/UMS.conf: Unable to load the configuration from the URL file:/root/.config/UMS/UMS.conf nor /etc/skel/.config/UMS/UMS.conf: Unable to load the configuration from the URL file:/etc/skel/.config/UMS/UMS.conf
User avatar
SubJunk
Lead Developer
Posts: 3705
Joined: Sun May 27, 2012 4:12 pm

Re: Docker

Post by SubJunk »

Hi Luthair, I think there are some issues with our Docker version at the moment which is why we haven't done an announcement or added instructions for it yet.
It might help if you could leave comments on GitHub at https://github.com/UniversalMediaServer ... /pull/1599 so that the developer who made that code can see
atamariya
Posts: 146
Joined: Sun Aug 11, 2013 1:15 am

Re: Docker

Post by atamariya »

You need to mount /profile (containing UMS.conf - this ensures your customization is not lost on restart) and /media (containing media files) to directories in local system. A sample below:

Code: Select all

docker run -it -p 5002:5002 -p 9001:9001 -v /c/Users/Downloads/:/media -v /c/Users/profile/:/profile ums
Luthair
Posts: 2
Joined: Wed Oct 24, 2018 2:29 pm

Re: Docker

Post by Luthair »

atamariya wrote: Thu Oct 25, 2018 5:08 pm You need to mount /profile (containing UMS.conf - this ensures your customization is not lost on restart) and /media (containing media files) to directories in local system. A sample below:

Code: Select all

docker run -it -p 5002:5002 -p 9001:9001 -v /c/Users/Downloads/:/media -v /c/Users/profile/:/profile ums
Yep, I mounted a directory to profile with a UMS.conf in it. From the logs however it does not appear to look there.
atamariya
Posts: 146
Joined: Sun Aug 11, 2013 1:15 am

Re: Docker

Post by atamariya »

Homer-S
Posts: 1
Joined: Wed Mar 27, 2019 8:37 am

Re: Docker

Post by Homer-S »

May I ask you for a little help. Maybe you can post your docker run command ...?
zoechi
Posts: 1
Joined: Fri May 03, 2019 5:00 am

Re: Docker

Post by zoechi »

go_nuts
Posts: 7
Joined: Sat Dec 08, 2018 7:09 am

Re: Docker

Post by go_nuts »

Similar issue ** Different user
I too am having issues with docker image
I also get a warning message that states

Can't load neither /root/.config/UMS/UMS.conf: Unable to load the configuration from the URL file:/root/.config/UMS/UMS.conf nor /etc/skel/.config/UMS/UMS.conf: Unable to load the configuration from the URL file:/etc/skel/.config/UMS/UMS.conf

I tried getting the docker image this way
docker pull universalmediaserver/ums

and also using the dockerfile on a 9.4.1

the docker run command that I am using is
sudo docker run -it -p 5001:5001 -p 9001:9001 -v /media/:/media -v /homeDirPath/.config/UMS:/profile universalmediaserver/ums:latest
/media - has media files
/profile - has UMS.config with needed config info.

when looking at the log I notice the docker ip 172.17.0.1
but I am able to access server through browser with http://localhost:5001/description/fetch and I do see the xml response.
I did notice that the tag showed the docker host address <URLBase>http://172.17.0.2:5001/</URLBase>

I checked the logs but I am not finding a debug.log in my .config/ it might be because of the docker container..
I assume that there is some docker setting that I am missing I am just not sure where it is .(kinda hoping I just used the command incorrectly)

If you need me to do more leg work I can do so.. like using trace mode I can do so ... but honestly think that this is more of a docker issue

I decided to try
docker run -it -v /opt/UMS/UMS/:/root/.config/UMS/ -v /media:/media -p 5001:5001 -p 9001:9001 ums:latest
and I didn't get the error message but still not working.
Also I am using a couple clients including my ps3 and vlc both are not finding the ums in docker container.
Attachments
ums.log
(13.79 KiB) Downloaded 582 times
maxq
Posts: 3
Joined: Wed Mar 17, 2021 12:06 am

Re: Docker

Post by maxq »

Hi all
Was there any resolution for this issue? I am currently testing ums docker and not able to define conf or media folder.
FixYourDockerfile
Posts: 2
Joined: Sun Apr 04, 2021 12:46 pm

Re: Docker

Post by FixYourDockerfile »

Alright, here's the deal. The dockerfile for the official Docker image contains several rough edges. Here's what you need in order to use the official Docker image.

Persistent Config
The default UMS config file inside the image is stored at /root/.config/UMS/UMS.conf so you could just map a volume to /root/.config/UMS/ and put a UMS.conf file in it but that isn't the best way.

The Dockerfile specifies that 2 volumes should be mounted: one at /profile and one at /media. As was alluded to by Luthair originally back in October of 2018 though, UMS does not appear to look for UMS.conf in /profile like one might assume. It appears to ignore that directory completely but if you do not map a volume to it then Docker will create an unnamed volume (if you're using docker-compose then it'll create a new unnamed volume each time you run docker-compose up). No good.

You need to set the UMS_PROFILE environment variable value to /profile to make UMS look there for UMS.conf when the container launches. If the UMS team would set this in the image then this would just work out of the box exactly like you would expect (i.e. /profile is automatically searched for UMS.conf).

Per the FAQ:
UMS also supports multiple profiles by means of the UMS_PROFILE environment variable.

If this variable is unset, the default profile directory is used to locate UMS.conf (and WEB.conf, if used).

If UMS_PROFILE is an absolute or relative (to the working directory) path pointing to an existing directory, then UMS.conf is loaded from and saved to that directory. If UMS_PROFILE is set, but doesn't point to an existing directory, it is assumed to be a relative or absolute path to a profile file. Note: while the file doesn't need to exist, the directory containing it must exist if the file is to be saved.
NOTE: the UMS.conf inside the container is rather bare and contains no comments. Here is the default UMS.conf file with comments.

Autodiscovery
If you want autodiscovery to function for your container, you'll need to configure networking for host mode (i.e. the container is attached to the host network directly and uses the host's IP address instead of being isolated and using NAT from the host IP address to an internal address). Next, to get the Java process to listen on the correct interface, you'll need to edit UMS.conf and set the network_interface value to the name of the interface on the Docker host that is connected to your LAN.

Other weirdness:
The Dockerfile strangely also specifies ports 1044, 5002, and 9001 (all TCP) yet the ports actually listening from the Java process within the container are 5001 TCP, 9001 TCP, and 1900 UDP.

The image also contains some other quirks such as .DS_Store and .dockerignore files being present in the working directory (/usr/src/ums).


Docker Compose
Here is a docker-compose.yml file you can use as a reference to get going. Modify to meet your specific needs.

Code: Select all

version: '3.7'

services:

  universalmediaserver:

    image: universalmediaserver/ums
    container_name: ums
    network_mode: host
    environment:
      - UMS_PROFILE=/profile
      
    volumes:
      - profile:/profile
      - media:/media:ro

    restart: always

volumes:
  profile:

  media:
Last edited by FixYourDockerfile on Sun Apr 04, 2021 4:19 pm, edited 1 time in total.
Post Reply