Roon running in Docker on Synology

I’ve just got roon running in a Docker container on my Synology 1512 NAS. It’s running well and it was really simple to do.

I’m using a ubuntu based image. I create an image based via a Dockerfile. Which looks like:

admin@DiskStation:~$ cat Dockerfile
############################################################
# Dockerfile to build Roon container images
# Based on Ubuntu
############################################################

# Set the base image to Ubuntu
FROM ubuntu

# File Author / Maintainer
MAINTAINER Ron

################## BEGIN INSTALLATION ######################

# Update the repository sources list once more
RUN apt-get update

# Install packages
RUN apt-get install -y curl
RUN apt-get install -y libav-tools
RUN apt-get install -y cifs-utils

##################### INSTALLATION END #####################


# Set default container command
CMD ["/tmp/roon.sh"]

admin@DiskStation:~$

Using this Dockerfile you can build an image:

sudo docker build -t roon .

Then I create a directory on the NAS /volume1/roon/

This directory contains roonserver-installer-linuxx64.sh and roon.sh

roon.sh is needed because the roon have combined setup and launch in the one script.

admin@DiskStation:~$ cat /volume1/roon/roon.sh
#!/bin/bash

echo "roon.sh called"
cat << 'EOF' | /tmp/roonserver-installer-linuxx64.sh 
y
y
EOF

# Keep Running
tail -f /dev/null

admin@DiskStation:~$

Then I can run the docker image ( my music is in /volume1/music ) :

sudo docker run --name roon --privileged --restart=always --net=“host” -v /volume1/roon:/tmp -v /volume1/music:/music roon

And that’s it roon is running on my Synology NAS!

4 Likes

Wow, impressive stuff!

Hi as I’m not familiar with the linux stuff above, is it possible to share the container image to the Synology hub so that we can use it easily ?

+1 for the container image.

Links with this topic in my view https://community.roonlabs.com/t/synology-spk-package-development/9796

Ooh, bravo. Would this run on QNAP’s Container Station, which supports Docker and LXC?

I expect so, Mark, as the benefit of containers, like these, is that you can run them on almost any host system, as they contain their own libraries or other dependencies.

So, try it out and let us know if you have it running on your QNAP :slight_smile:

Will try to. Anyone know if the OP has published the image to the Docker Hub?

Should this same image work on unRAID 6.x since it supports docker? Anyone tried this out or obtained the image? Thanks!

Would the 64bit limitation apply for this method too? Or could it work on any NAS that support Docker??

Hi,

You can pull the image by:

docker pull ronch/roon-server

You will need to run this image as privileged and with net option host. This is tested on a Synology 1512 with 3GB RAM. On the Synology this image breaks if stopped and started with the Docker package, so on Synology you’ll have to use the command line ( and use restart always ).

So your command line should look like:

sudo docker run --name roon --privileged --restart=always --net=“host” -v /volume1/music:/music ronch/roon-server

This mounts a volume /music in the container, from the music on the host in /volume1/music

The Dockfile is now:

admin@DiskStation:~$ cat Dockerfile 
############################################################
# Dockerfile to build Roon container images
# Based on Ubuntu
############################################################

# Set the base image to Ubuntu
FROM ubuntu

# File Author / Maintainer
MAINTAINER Ron

################## BEGIN INSTALLATION ######################

# Update the repository sources list
RUN apt-get update

# Install packages
RUN apt-get install -y curl
RUN apt-get install -y libav-tools
RUN apt-get install -y cifs-utils
ADD http://download.roonlabs.com/builds/roonserver-installer-linuxx64.sh /tmp
run chmod 700 /tmp/roonserver-installer-linuxx64.sh

##################### INSTALLATION END #####################


# Set default container command
CMD printf "y\ny\n" | /tmp/roonserver-installer-linuxx64.sh && tail -f /dev/null

@RonCH many thanks for this guide!

may i ask if also your roon client asks for re-authorizing after each restart of docker-ed roonserver?
i’m thinking this could be due to dynamically assigned ip for each new container instance…
…and i’m running the docker on the ubuntu-14.04, not the Synology (as I only have older Qnap NAS without docker support :expressionless: )

No, I don’t have to reauthorise. Once you reauthorise is it recreating your library?

once authorized It starts up normally, but i have to check again to be sure , will let you know then

Thanks for this RonCH! Your image works perfectly! (for me anyway:)

Thanks very much for this.

Has anyone had success setting this up on Unraid 6 at all?

I have got it downloaded and in a docker on Unraid, which runs, but cannot see how to link the locations of the libraries etc to those on unraid.

Although it runs and the logs says it should be installed ok, the clients cannot see it.

Is possible to modify this docker for unpaid?

Thanks in advance

Ok, so I realised I had it set as bridged and not host, so set that, as well as clicking the privileged option on unraid.

Unfortunately even though everything looks fine and dandy, the clients still don’t see it.

Will have another look later to see if i am missing the obvious :slight_smile:

Ok it just needed some time it seems, as it is now running great on Unraid 6 :smile:

Think I need to set some ENV variables to give the docker access to the music files on my music share, but will look at that later.

Thanks for the docker template @RonCH

how does discovery and networking work out when in docker?

When docker container is run with network “host” mode, all network stack is available within container. You can use “bridge” mode as well, but first you must forward necessary ports from host to docker container.

I’ve successfully run RoonServer docker container under unRAID NAS software - https://lime-technology.com/application-server/, and it works without any problems. I’ve setup container with external path mappings for library and application itself, so rebuild docker container is painless and library is persistent.