Dockerfiles and image for librespot-java with alsa backend.
librespot-java is a port of librespot, originally written in Rust, which has evolved into the most up-to-date open-source Spotify client.
Pull and deploy (multiarch) image in a Docker container:
docker run -d --network host agneev/librespot-java
git clone https://github.com/agneevX/librespot-java-docker
cd librespot-java-docker
docker compose up -d
To pull the image only, run:
docker pull agneev/librespot-java
This compiles from the latest code in the master
branch of librespot-java
.
git clone https://github.com/agneevX/librespot-java-docker
docker build . -f ./source.Dockerfile -t librespot-java:master
docker run -d --network host librespot-java:master
The main config file is available in ./user-data/config.toml
. Settings such as device name or sound quality can be customized here.
librespot-java documentation available here.
For audio output, I've set player.mixerSearchKeywords
to plughw:0,0
on the Raspberry Pi 4, so it's able to output properly.
By default, the compose files use host networking (not available on Windows) so that devices in the LAN are able to connect (although there's a delay).
Connecting to a Spotify Premium account is recommended. The docs is linked above.
When connected, network_mode: host
can be removed in the compose file and brought up.