docker-pulseaudio-example
docker-pulseaudio-example copied to clipboard
Getting an access denied
I tried running the minimal sample with either root or not (not that as non-root from within the container the user cannot access the pulse socket):
$ docker run -it --user root --volume=/run/user/$(id -u)/pulse:/run/user/1000/pulse thebiggerguy/docker-pulseaudio-example
Opening a playback stream with sample specification 's16le 2ch 44100Hz' and channel map 'front-left,front-right'.
Connection failure: Access denied
Else this would allow to simplify https://github.com/wernight/docker-mopidy
Pulseaudio uses a cookie for authentication. It is available in ~/.config/pulse/cookie
and needs to be copied to the container. It's not entirely straightforward to do this as the cookie has 600 as permissions, but you can probably use docker cp
to copy it. Or do as I do and send it base64 encoded into the container using an environment variable.