docker-pulseaudio-example icon indicating copy to clipboard operation
docker-pulseaudio-example copied to clipboard

Getting an access denied

Open wernight opened this issue 7 years ago • 1 comments

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

wernight avatar Jul 20 '17 09:07 wernight

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.

janderholm avatar Jul 09 '18 10:07 janderholm