Git Product home page Git Product logo

docker-spotify's Introduction

What

Docker image for a Spotify Connect endpoint.

This is based on LibreSpot.

This is useful in the following scenarios:

  1. you are a hobbyist and you want to turn a small appliance connected to speakers into a Spotify Connect receiver (typically a raspberry pi)
  2. that's it :-)

Image features

  • multi-architecture:
    • linux/amd64
    • linux/arm64
  • hardened:
    • image runs read-only
    • image runs with no capabilities but NET_BIND_SERVICE
    • process runs as a non-root user, disabled login, no shell
  • lightweight
    • based on our slim Debian Bullseye
    • simple entrypoint script
    • multi-stage build with no installed dependencies dependent on the following for the runtime image:
      • libpulse0
      • libasound2
  • observable
    • healthcheck
    • log to stdout
    • prometheus endpoint

unsupported (probably builds - but I lost interest):

  • linux/arm/v7
  • linux/arm/v6
  • linux/386
  • linux/ppc64le
  • linux/s390x

Run

The following is the most straight-forward example, using host networking:

docker run -d --rm \
    --name "spot" \
    --env "MOD_MDNS_NAME=Super Name For Your Spotify Connect Endpoint" \
    --volume /tmp \
    --group-add audio \
    --device /dev/snd \
    --net host \
    --cap-drop ALL \
    --read-only \
    docker.io/dubodubonduponey/spotify

Notes

Networking

You need to run this in host or mac(or ip)vlan networking (because of mDNS).

Additional arguments

Any additional arguments when running the image will get fed to the librespot binary.

This is specifically relevant if you need to select a different alsa device, card or mixer, or use another librespot option.

Here is an example:

docker run -d --rm \
    --name "spot" \
    --env "MOD_MDNS_NAME=Super Name For Your Spotify Connect Endpoint" \
    --volume /tmp \
    --group-add audio \
    --device /dev/snd \
    --net host \
    --cap-drop ALL \
    --read-only \
    docker.io/dubodubonduponey/spotify \
    --device default:CARD=Mojo \
    --enable-volume-normalisation \
    -v

For a reference of all librespot options, try:

docker run --rm \
    docker.io/dubodubonduponey/spotify \
    --help

Custom configuration

You may specify the following environment variables at runtime:

  • MOD_MDNS_NAME (eg: Totale Croquette) controls the "name" under which your endpoint will appear in Spotify

You can also tweak the following for control over which internal ports are being used:

  • PORT (eg: 10042) controls the port used by the http command endpoint

Of course using any privileged port for that would require CAP_NET_BIND_SERVICE.

Moar?

See DEVELOP.md

docker-spotify's People

Contributors

dubo-dubon-duponey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

barrettlowe dddw

docker-spotify's Issues

More audio backends

Would it be possible (or are there any downsides) to this image including librespot built with more of the audio backends, at least the ones that apply to Linux? I'm mainly interested in PulseAudio, but it seems like the others might be generally useful.

I tried adding it myself to the Dockerfile, but I couldn't get the image to build locally using the development instructions.

Thanks!

Update README.md with dockerhub image ?

Hello !

Could you update the examples in README.md, with the correct image location ?

Currently: ghcr.io/dubo-dubon-duponey/spotify
Should be (after following the "about" link): docker.io/dubodubonduponey/librespot

Thanks !

Audio normalization?

This docker container works really well! Thank you. But I’m noticing that volume levels are all over the place from song to song. I noticed in the install instructions here that you can add “--enable-audio-normalisation” (specifically with the seemingly British spelling) as a run command in the docker compose. I did that, but it just errors out.

Does anyone know how to properly activate audio normalization for this container?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.