Volumio2 - Docker on RPi3 ?

Hello all,

Still trying to use my raspberry pi for several applications including volumio2 and I would like to know if someone has implemented docker with Volumio2 on raspberry pi ?

I can build the docker image myself but before spending time, I would like to know if the device “/dev/snd” and the USB output can be handle easily within the docker with Volumio2.

Thanks in advance for the feedback.

If you clone the build script:
github.com/volumio/Build

and you build it with the -l option, it will build a docker image for you .

./build.sh -b arm -d pi -v 2.064 -l dockervolumio 

However mind that performances under container will no way be comparable by running natively, and lot of stuff like sound and networking might act quite weird.
I suggest to install the new stuff on top of Volumio, not the other way around …

Thanks, I’ll give the build.sh a try, I am not so concerned about the performance for the moment as Docker does not add to much overhead (using volume to expose host directory should help).

I am more concerned as you said about systemd implementation with a docker container and the network/device sharing aspect.

I tried to update the volumio image but I faced many issues when for example I wanted to use the “WIFI hotspot” differently to be able to use it as a “normal wifi hotspot”.

So I am in the same position that I would want to run volumio on an existing RPi setup and this seems to be the least painful (i was not able to manually install volumio on a running raspbian).

On my linux PC I have managed to create a docker image from the Volumio build scripts and it runs; I can point my webbrowser at the docker container port and I get the anjular interface.

However the problem i am facing is with regard to mpd; my initial thoughts after looking at some of the js code was to simply point the volumio configuration (which is out of the image) to the MPD process on another host. There is a configuration file under /data that appears to let you specify the host (i used my MPD’s ip) and port which I updated.

BUT then using the browser to browse anything fails to return anything - the mpd on the other box is running and I can connect to it using mpc.

I’ve also burned an image to an SD and run this on a RPI with again, the MPD referencing another box BUT this fails too.

Has anyone overcome this problem to get volumio running within docker and/or got volumio to talk to a remote mpd process?

EDIT: clarify why I want to use external MPD

My RPI 3 is connected to an IQaudio DAC and the MPD process on the bare metal is configured to send output to the DAC via the “hw:1,0” interface. I am not aware what items of the audio subsystem (/dev/snd etc) would need/possible to expose to the container such that the container’s MPD process could talk directly to the h/w DAC.

@whatdoido, have you made any progress on this and tried to run Volumio completely in a container?

I’ve made small progress but it’s not great

Just to step back a little:

  • i’m creating an x86 image for now (so i can easily test this on a PC)
  • my linux boxes are all fedora so i’ve created a VMware install of jessie
  • builds are on an NFS mount between fedora host and vmware jessie - vmware’s shared dirs don’t work
  • volumio builds take a looooonnngggg time (~3hrs) - it may be the NFS

I can create the docker image and start it, mapping /data to the localhost but the most recent build, volumio does not start complaining about albumart (i’m not at my laptop now to recreate the exact image) - a previous image built didnt have this so i dont know if the git pull has any broken code.

my plan still is still to have the docker container refer to an external mpd process although i did notice the from within docker volumio container i was able to play a wav after running with “–device /dev/snd”

I was able to make an image but ran into some other issues (don’t remember at the top of my head). But what I ended up thinking that it doesn’t seem the way to go for this software as it has a build it update function to keep it current. My need for Docker to run this was to keep current on an x86 without having to re-image by SSD for each Volumio update. Docker is still nice to do this in but not sure if it is the only way to meet that objective now. I assume Volumio update function not only updates the volumio folder but run scripts to update other affected libraries?

UPDATE: Here is the error I get when starting Volumio in a running container:

root@31e0683b895e:/# volumio start
Failed to get D-Bus connection: Unknown error -1

I then started mpd and still same error. I assume there are other things that should be running first?:

root@31e0683b895e:/var/log# service mpd start
[ ok ] Starting Music Player Daemon: mpd.
root@31e0683b895e:/var/log# volumio start
Failed to get D-Bus connection: Unknown error -1
root@31e0683b895e:/var/log# ps -ef
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 14:41 ?        00:00:00 bash
mpd         35     1  0 14:43 ?        00:00:00 /usr/bin/mpd /etc/mpd.conf
root        62     1  0 14:44 ?        00:00:00 ps -ef

It looks like at least these two need to be started:

xinit /etc/X11/Xsession /opt/volumiokiosk.sh -- /etc/X11/xinit/xserverrc :0 -auth /tmp/serverauth.rn3h55pfdt
/usr/local/bin/node /volumio/index.js

Looking at systemctl from a working Volumio install, they have these Volumio services listed:

volumio-kiosk.service                                                                    loaded active running   Start Volumio Kiosk
volumio-network.service                                                                  loaded active exited    Restart Volumio Network
volumio-remote-updater.service                                                           loaded active running   volumio-remote-updater.service
volumio.service                                                                          loaded active running   Volumio Backend Module

BTW - the D-Bus error is the same running in Docker as when doing ‘volumio start’, so may not be a volumio issue per se. May be a systemd issue and need --priviledge to run:

root@31e0683b895e:/var/log# systemctl 
Failed to get D-Bus connection: Unknown error -1

I use this to start the container, ampping a bunch of volumes and including the /run/dbus (and in my case the /data dir so i can have consistent cfg acrpss reboots of container)

exec docker run -it \ -v /run/dbus/:/run/dbus/ \ -v /dev/shm:/dev/shm \ -v /export/src/volumio/docker/data:/data \ --device /dev/snd \ -p 3000:3000 \ volumio "$@"

The last time i had it succesfully running (providing access to the URL) I ran into a bunch of problems with mpd which is why i was tring to modify the /data/configuration/music_service/mpd/config.json to point at an mpd outside of the container.

As I write this, I am cloning a new Build and starting the build process again in my vmware image…

I tried sharing the /run/dbus with the host, still the same error.