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: