mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 00:05:55 +03:00
[GH-ISSUE #292] Running librespot in a docker container #198
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#198
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mordax7 on GitHub (Feb 23, 2019).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/292
Hello everyone,
Just wanted to ask if anyone already tried to run librespot in a docker container?
I came so far that I am able to see the device in spotify connect, but afterwards it disconnects and I cannot see it anymore, also in that time I cannot play any songs.
Here are the logs I can get over
docker logs:Here is my Dockerfile:
PS: I am also new into Docker, so I know this is not best practice here. I am happy for improvement suggestions.
@sashahilton00 commented on GitHub (Mar 11, 2019):
I suspect zeroconf in docker is going to be problematic
@mordax7 commented on GitHub (Mar 11, 2019):
Zeroconf should work in docker, why?
Found out one of the ways how to do it, just mount /dev/snd and it should work. It includes the audio data sinks.
@sashahilton00 commented on GitHub (Mar 11, 2019):
Just based on other problems we've seen around here w/ regards to zeroconf problems, though if it works for you, great. We're not going to be giving much/any time to supporting Docker though, as there are more pressing priorities. Good luck getting it running though.
@mordax7 commented on GitHub (Mar 11, 2019):
I will try to find a bit more proficient way of doing it, afterwards I will release it to github and update this ticket...
@titilambert commented on GitHub (Apr 21, 2019):
@xMordax which command do you use to launch you docker container ?
@dubo-dubon-duponey commented on GitHub (Nov 9, 2019):
I managed to have it work in a container after some tinkering.
zeroconf is not an issue in itself (granted you use the appropriate networking mode for your container - eg: host or mac/ip vlan - bridge of course will not work).
It seems that librespot will not work if there is no ipv6 though (and I couldn't find a way to disable ipv6 in librespot) (disclaimer: I'm new to librespot, apologies if I'm mistaken or otherwise missed something on that part)
So, the trick is to enable ipv6 for docker, eg: /etc/docker/daemon.json
Once done, and granted your networking is in order, librespot will properly advertise and accept input (I'm using macvlan on wired machines, and ipvlan on wifi devices - but I assume host networking would work as well if you can't be bothered to setup mac/ip vlan).
I'm still struggling to get it use an alsa card other than hw:0, but that's a different problem.Here is a github repo with a working multi-arch image:
https://github.com/dubo-dubon-duponey/docker-librespot
Image can be pulled from the Hub as well:
https://hub.docker.com/r/dubodubonduponey/librespot/tags
I'll add detailed instructions on the networking part later on but the above should be enough to get going...
Hope that helps.
@dubo-dubon-duponey commented on GitHub (Nov 9, 2019):
Seems like the requirement for ipv6 came from the mdns library being used
github.com/plietar/rust-mdns@0974ab4ff7/src/lib.rs (L109)Which is no longer true since
github.com/librespot-org/librespot@d91bf573a4landed.@xMordax updating to librespot v0.1.0 or more recent should "fix" your problem (making it unnecessary to setup ipv6 for docker)
^ again, my understanding of librespot is limited, so, take it with a grain of salt - bottom-line though, I'm now running
d91bf573a4WITHOUT any ipv6 monkeying, on a raspberry pi.Librespot rocks! ;-)
@ashthespy commented on GitHub (Nov 9, 2019):
That's not really an error, but more the library warning you that it didn't find any ipv6 interface - it can be ignored.
@dubo-dubon-duponey commented on GitHub (Nov 10, 2019):
Well, it still seems that librespot (before
d91bf573a4) will not work without ipv6... so...Either way the latest does not exhibit the same behavior, and does work (with or) without ipv6, which is great!
@kingosticks commented on GitHub (Nov 10, 2019):
I have never seen that warning ever cause an actual problem. Librespot certainly has never required ipv6 to work (at least outside of the world of docker networking).