Dockerized SnapServer, using minimal footprint base image (Alpine).
100K+
SnapCast is a multiroom client-server audio player, where all clients are time synchronized with the server to play perfectly synced audio. It's not a standalone player, but an extension that turns your existing audio player into a Sonos-like multiroom solution. The server's audio input is a named pipe /tmp/snapfifo. All data that is fed into this file will be sent to the connected clients. One of the most generic ways to use Snapcast is in conjunction with the music player daemon (MPD) or Mopidy, which can be configured to use a named pipe as audio output.
This repository contains the scripts to auto-build images for SnapServer (the server part of the solution) for the ARM architecture. The base image is {arch}/alpine:latest, and the binaries are built from source instead of using pre-built binaries from the package archive.
Unfortunately Docker auto-build has been discontinued for free use, so I have to manually build, push and create manifests. If you want to do this yourself, no problem.
chmod +x)./build-multiarch.sh -t <any_tag_you_want> -f <dockerfile>
e.g. ./build-multiarch.sh -t saiyato/snapserver:arm32v7 -f Dockerfile.arm32v7Want to upload it to your own Docker Hub repo? Also no problem
docker login) to save your credentials on your machine./push_to_dockerhub.sh -i <the_image_you_want_to_upload_for>
e.g. ./push_to_dockerhub.sh -i saiyato/snapserverNote that the upload script will look for the arm32v6, arm32v7, arm64v8, amd64 and i386 tags to push and annotate.
The Dockerfiles can be found in my GitHub project and they're built cross platform, qemu is downloaded in the builder to allow for arm builds on commodity hardware and Docker Hub. Development packages and the source code are downloaded, whereafter the binary is built from source. The container is then cleaned from any build artifacts and the dependencies are added. As a final step, a vulnerability scan is performed by microscanner (Aqua Security).
To use the images, run (which automatically pulls) the image from the repo and set necessary parameters;
pipe://{fifo pipe}?{name}&{mode}&{sample format})You can overwrite SnapCast's config by mounting a file to /etc/snapserver.conf in the container. The default settings create a single stream called "SnapServer". See the Snapcast docs to create your own config.
The below example demonstrates how you can run the container using the above information. Note that I have added the --rm option, to auto-delete the container after exiting (for cleanup purposes).
docker run \
--rm \
--network host \
--name snapserver \
-v /tmp/snapfifo:/tmp/snapfifo \
saiyato/snapserver:{arch} \
--stream.stream pipe:///tmp/snapfifo?name={stream_name}&mode=read&sampleformat=44100:16:2
Or, if you want it to be hosted on a separate IP
docker run \
--rm \
--name snapserver \
-v /tmp/snapfifo:/tmp/snapfifo \
-p 1704:1704 \
-p 1705:1705 \
-p 1780:1780 \
saiyato/snapserver:{arch} \
--stream.stream pipe:///tmp/snapfifo?name={stream_name}&mode=read&sampleformat=44100:16:2
Or as a docker-compose
version: "3"
services:
snapserver:
image: saiyato/snapserver:{arch}
container_name: snapserver
restart: unless-stopped
network_mode: host
volumes:
- /tmp/snapfifo:/tmp/snapfifo
command: --stream.stream pipe:///tmp/snapfifo?name={stream_name}&mode=read&sampleformat=44100:16:2
Where {arch} should denote the architecture you're running on (e.g. arm32v6, arm64v8, amd64 etc). And {stream_name} should denote the name you want to assign to the particular stream.
Test your setup by connecting to the server (easiest way is to use SnapDroid from the App Store) and stream noise into the fifo file.
sudo cat /dev/urandom > /tmp/snapfifo
Content type
Image
Digest
Size
6.7 MB
Last updated
over 4 years ago
docker pull saiyato/snapserver