From: Christian König Date: Sun, 5 Feb 2023 19:29:49 +0000 (+0100) Subject: Allow passing arguments via environment variable X-Git-Tag: 4.2.1d0~21^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f79c3e1579bee23799c9345c685cf6ee2be24044;p=thirdparty%2Fshairport-sync.git Allow passing arguments via environment variable Signed-off-by: Christian König --- diff --git a/docker/Dockerfile b/docker/Dockerfile index f1ea8d66..47e9de46 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -113,5 +113,3 @@ RUN addgroup -g 29 docker_audio && addgroup shairport-sync docker_audio && addgr # Remove anything we don't need. RUN rm -rf /lib/apk/db/* - -ENTRYPOINT [ "/init" ] diff --git a/docker/README.md b/docker/README.md index 295d2170..9953cefc 100644 --- a/docker/README.md +++ b/docker/README.md @@ -31,11 +31,12 @@ $ docker run -d --restart unless-stopped --net host --device /dev/snd \ ### Options -Command line options will be passed to Shairport Sync. Here is an example: +To pass command line options to Shairport Sync they need to be set with `-e ARG=`. Here is an example: + ``` $ docker run -d --restart unless-stopped --net host --device /dev/snd \ - mikebrady/shairport-sync:latest \ - -v --statistics -a DenSystem -d hw:0 -c PCM + -e ARG="-v --statistics -a DenSystem -d hw:0 -c PCM" \ + mikebrady/shairport-sync:latest ``` This will send audio to alsa hardware device `hw:0` and make use of the that device's mixer control called `PCM`. The service will be visible as `DenSystem` on the network. diff --git a/docker/classic/Dockerfile b/docker/classic/Dockerfile index f6cb01c7..962ef28c 100644 --- a/docker/classic/Dockerfile +++ b/docker/classic/Dockerfile @@ -91,5 +91,3 @@ RUN addgroup -g 29 docker_audio && addgroup shairport-sync docker_audio && addgr # Remove anything we don't need. RUN rm -rf /lib/apk/db/* - -ENTRYPOINT [ "/init" ] diff --git a/docker/classic/etc/s6-overlay/s6-rc.d/04-shairport-sync/run b/docker/classic/etc/s6-overlay/s6-rc.d/04-shairport-sync/run index c533db5e..5642097d 100644 --- a/docker/classic/etc/s6-overlay/s6-rc.d/04-shairport-sync/run +++ b/docker/classic/etc/s6-overlay/s6-rc.d/04-shairport-sync/run @@ -4,4 +4,4 @@ while [ ! -f /var/run/avahi-daemon/pid ]; do sleep 1 done echo "Starting shairport-sync" -exec /usr/local/bin/shairport-sync +exec /usr/local/bin/shairport-sync $ARG diff --git a/docker/etc/s6-overlay/s6-rc.d/05-shairport-sync/run b/docker/etc/s6-overlay/s6-rc.d/05-shairport-sync/run index c533db5e..5642097d 100644 --- a/docker/etc/s6-overlay/s6-rc.d/05-shairport-sync/run +++ b/docker/etc/s6-overlay/s6-rc.d/05-shairport-sync/run @@ -4,4 +4,4 @@ while [ ! -f /var/run/avahi-daemon/pid ]; do sleep 1 done echo "Starting shairport-sync" -exec /usr/local/bin/shairport-sync +exec /usr/local/bin/shairport-sync $ARG