Containerized Mopidy with every official plugin as well as popular extras.
100K+
Containerized Mopidy music server with support for MPD clients and HTTP clients.
Originally a fork of https://github.com/wernight/docker-mopidy, but has been highly modified since.
Ubuntu official (ubuntu:latest)Dockerfile.app user inside the container for security.You may install additional backends or frontends.
First to make audio from from within a Docker container, you should enable PulseAudio over network; so if you have X11 you may for example do:
Install PulseAudio Preferences. Debian/Ubuntu users can do this:
$ sudo apt-get install paprefs
Launch paprefs (PulseAudio Preferences) > "Network Server" tab > Check "Enable network access to local sound devices" (you may check "Don't require authentication" to avoid mounting cookie file described below).
Restart PulseAudio
$ sudo service pulseaudio restart
or
$ pulseaudio -k
$ pulseaudio --start
On some distributions, it may be necessary to completely restart your computer. You can confirm that the settings have successfully been applied running pax11publish | grep -Eo 'tcp:[^ ]*'. You should see something like tcp:myhostname:4713.
A script is provided to easily start a container using the latest image against your local pulseaudio daemon: run.
It's also stored in the image for easy access.
Use it like so, all options are optional, although the more you provide the more functionality you'll have.
docker run --rm trevorj/mopidy-extras host run \
-o spotify/username='BLAH' -o spotify/password='BLAH' \
-o gmusic/username='BLAH' -o gmusic/password='BLAH' \
-o spotify_web/client_id='BLAH' -o spotify_web/client_secret='BLAH' \
-o scrobbler/username='BLAH' -o scrobbler/password='BLAH' \
-o audioaddict/username='BLAH' -o audioaddict/password='BLAH' \
-o soundcloud/auth_token='BLAH' \
| bash
You can also use docker-compose using the provided docker-compose.yml file. This works by forwarding your local
PulseAudio configuration into the container as a volume instead of passing in the cookie as an environment variable.
# in repo
docker-compose run --service-ports mopidy \
-o spotify/username='BLAH' -o spotify/password='BLAH' \
-o gmusic/username='BLAH' -o gmusic/password='BLAH' \
-o spotify_web/client_id='BLAH' -o spotify_web/client_secret='BLAH' \
-o scrobbler/username='BLAH' -o scrobbler/password='BLAH' \
-o audioaddict/username='BLAH' -o audioaddict/password='BLAH' \
-o soundcloud/auth_token='BLAH'
See mopidy's command for possible additional options.
Most elements are optional (see some examples below). Replace BLAH' accordingly if needed, or disable services (e.g., -o spotify/enabled=false`):
Ports:
Environment variables:
PULSE_SERVER - PulseAudio server socket.PULSE_COOKIE_DATA - Hexadecimal encoded PulseAudio cookie commonly at ~/.config/pulse/cookie.Volumes:
/app/Music ($XDG_MUSIC_DIR) - Path to directory with local media files (optional)./app/.local/share/mopidy ($XDG_DATA_HOME/mopidy) - Path to directory to store local metadata such as libraries and playlists in (optional).Give read access to your audio files to user 1000 (app ala $APP_USER), group 1000 (app) or 29 (audio), or even all users (e.g., $ chgrp -R 29 $PWD/media && chmod -R g+r $PWD/media).
Index local files:
$ docker run --rm trevorj/mopidy-extras host run mopidy local scan | bash
Start the server:
docker run --rm trevorj/mopidy-extras host run \
-o spotify/username='BLAH' -o spotify/password='BLAH' \
-o gmusic/username='BLAH' -o gmusic/password='BLAH' \
-o spotify_web/client_id='BLAH' -o spotify_web/client_secret='BLAH' \
-o scrobbler/username='BLAH' -o scrobbler/password='BLAH' \
-o audioaddict/username='BLAH' -o audioaddict/password='BLAH' \
-o soundcloud/auth_token='BLAH' \
| bash
Browse to http://$HOST:6680/
$ xdg-open http://$HOST:6680
Start the server using the commands above, then run ncmpcpp any usual way, ala:
$ docker run --rm -it wernight/ncmpcpp ncmpcpp --host "$HOST"
Having more issues? Report a bug on GitHub. Also if you need some additional extensions/plugins that aren't already installed (please explain why).
Content type
Image
Digest
Size
280.3 MB
Last updated
over 8 years ago
docker pull trevorj/mopidy-extras