Browse Source

alpine:testing package, spotify ui lists server with "Can't play this right now"

Fabian Peter Hammerle 3 years ago
commit
48bdec5465
2 changed files with 50 additions and 0 deletions
  1. 15 0
      Dockerfile
  2. 35 0
      docker-compose.yml

+ 15 - 0
Dockerfile

@@ -0,0 +1,15 @@
+FROM alpine:3.13.1
+
+ARG LIBRESPOT_PACKAGE_REPOSITORY=http://dl-cdn.alpinelinux.org/alpine/edge/testing
+ARG LIBRESPOT_PACKAGE_VERSION=0.1.3-r1
+ENV LIBRESPOT_CACHE_PATH=/var/cache/librespot
+RUN apk add --repository=$LIBRESPOT_PACKAGE_REPOSITORY --no-cache \
+        librespot=$LIBRESPOT_PACKAGE_VERSION \
+    && mkdir $LIBRESPOT_CACHE_PATH \
+    && chown librespot $LIBRESPOT_CACHE_PATH
+VOLUME $LIBRESPOT_CACHE_PATH
+
+RUN apk add --no-cache strace
+
+USER librespot
+CMD ["librespot", "--help"]

+ 35 - 0
docker-compose.yml

@@ -0,0 +1,35 @@
+version: '2.3'
+
+volumes:
+  cache:
+
+services:
+  librespot:
+    build: .
+    image: docker.io/fphammerle/librespot
+    group_add: [29] # stat --format='%g %n' /dev/snd/*
+    command: librespot
+      --cache /var/cache/librespot
+      --name librespot-docker-compose-test
+      --device-type computer
+      --verbose
+      --backend alsa
+      --device surround21
+      --enable-volume-normalisation
+      --volume-ctrl linear
+      --initial-volume 25
+    read_only: yes
+    volumes:
+    - type: volume
+      source: cache
+      target: /var/cache/librespot # $LIBRESPOT_CACHE_PATH
+    devices:
+    - /dev/snd
+    userns_mode: host
+    network_mode: host
+    cap_drop: [all]
+    security_opt: [no-new-privileges]
+    cpus: 0.4
+    mem_limit: 32M
+
+# https://docs.docker.com/compose/compose-file/compose-file-v2/