These is the Docker images that I'm currently using to run Mopidy and Snapserver on a Raspberry Pi 3a, and Snapclient with a PhatDAC or IQAudio Pi-DACZero on a Raspberry Pi Zero.
It probably won't be exactly the setup you want, but feel free to create a fork for your own setup.
The Mopidy version and all extensions to be installed are defined in requirements.txt
.
I have music files in ~/music
that I mount into the container.
Build on PC
docker compose build mopidy snapserver --build-arg BUILD_FROM=docker.io/debian:bookworm-slim --build-arg ARCH=amd64
Build on Raspberry Pi (takes about 40 minutes on Pi 3)
docker compose build mopidy snapserver
docker compose up mopidy snapserver -d
docker compose up snapclient -d
View logs:
docker logs -f mopidy
Execute any Mopidy command:
docker exec mopidy mopidy <cmd>
docker exec mopidy mopidy config
docker exec mopidy mopidy deps
- Burn Raspberry PI OS to SD card (16GB+). Put SD card in Raspberry Pi.
- Copy files to the Pi.
make upload-snapserver
snapserver
docker-compose.yml
Dockerfile
Makefile
mopidy.conf
requirements.txt
ssh
onto Pi- Install Docker CE.
- Run the
build
command - Mount music from USB (see below)
- Run container
docker compose up mopidy snapserver -d
- Reboot
- Scan for music
docker exec mopidy mopidy local scan
- Install Raspberry Pi OS
- Copy files to the Pi.
make client=office upload
make client=kitchen upload
ssh
onto Pi- Install Docker CE
- Run
docker compose build snapclient
- Install soundcard (see below)
- Reboot
- Run container
docker compose up snapclient -d
https://learn.pimoroni.com/tutorial/phat/raspberry-pi-phat-dac-install
Their install script doesn't work for Raspberry Pi OS Bookworm. I managed to get it working.
Edit /boot/firmware/config.txt
.
Remove this line:
dtparam=audio=on
Add this line:
dtoverlay=hifiberry-dac
Maybe enable I2C or something in raspi-config
?
https://github.com/iqaudio/UserDocs/blob/master/userguide.pdf
Edit /boot/firmware/config.txt
.
Remove this line:
dtparam=audio=on
Add this line:
dtoverlay=iqaudio-dacplus
mkdir ~/usb
mkdir ~/music
Add these lines to /etc/fstab
.
/dev/sda1 /home/jonathan/usb vfat defaults 0 0
/home/jonathan/usb/music /home/jonathan/music none defaults,rbind 0 0