Containerized Tizonia cloud music player that uses the host's sound system.
Tizonia connects as a client directly to the hosts PulseAudio server and uses its configuration/devices to output the sound. This is achieved by mapping the UNIX socket used by PulseAudio in the host into the container and configuring its use.
Credits: Method borrowed from docker-pulseaudio-example.
Use the convenience script docker-tizonia:
#!/bin/bash
USER_ID=$(id -u);
GROUP_ID=$(id -g);
docker run -it --rm \
-e PULSE_SERVER=unix:${XDG_RUNTIME_DIR}/pulse/native \
--volume=${XDG_RUNTIME_DIR}/pulse:${XDG_RUNTIME_DIR}/pulse \
--volume="${HOME}/.config/tizonia":/home/tizonia/.config/tizonia \
--volume "${HOME}/.config/pulse/cookie":/home/tizonia/.config/pulse/cookie \
--name tizonia \
tizonia/docker-tizonia "$@";
The script bind mounts the host's '$HOME/.config/tizonia' to make 'tizonia.conf' available inside the container.
NOTE: The Tizonia process running inside the container needs 'rwx' permissions on this directory.
Once the script is in your path, and the permissions of '$HOME/.config/tizonia' have been changed, just use the usual Tizonia commands:
# Change Tizonia's config dir permissions
$ chmod a+wrx $HOME/.config/tizonia
# Install the wrapper script in a location in your PATH
$ sudo install docker-tizonia /usr/local/bin
# Pass the usual Tizonia commands to the wrapper
$ docker-tizonia --youtube-audio-mix-search "Queen Official"
The Unlicense.
See tizonia-openmax-il.