This is the Docker image that I'm currently using to run Mopidy on a Raspberry Pi Zero with PhatDAC.
It probably won't be exactly the setup you want, but feel free to create a fork for your own setup.
Build:
docker build -t jjok/mopidy .
docker build -t jjok/mopidy -f Dockerfile.pi .
Run:
docker run -it --rm --device /dev/snd --name mopidy -p 6600:6600 -p 6680:6680 jjok/mopidy
Run in background:
docker run -d --restart=unless-stopped --device /dev/snd --name mopidy -p 6600:6600 -p 6680:6680 jjok/mopidy
View logs:
docker logs mopidy
Execute any Mopidy command:
docker exec mopidy mopidy <cmd>
docker exec mopidy mopidy config
docker exec mopidy mopidy deps
- Burn Raspbian to SD card (8GB+). A 2GB SD card will not be big enough for both Raspbian and the Docker image.
- Put SD card in Raspberry Pi 2 (or 3). A Pi Zero does not have enough RAM to build the Docker image.
- Install Docker CE.
This is nice and easy these days. Just download as
.sh
file and run it. Actually, Docker > 17 doesn't seem to work on a Pi Zero.sudo apt install docker-ce=17.12.1~ce-0~raspbian
sudo apt-mark hold docker-ce
- Copy
Dockerfile.pi
,requirements.txt
andmopidy.conf
to the Pi. - Run
build
command (takes around 45 minutes on Pi 2) - Put SD card in Pi Zero
- Run "Run in background" command
- Install soundcard (PhatDAC) https://learn.pimoroni.com/tutorial/phat/raspberry-pi-phat-dac-install
- Reboot