From 5149854a2bf469a47960665a7d1862f9df6ab0a4 Mon Sep 17 00:00:00 2001 From: Charles <32498151+charlesomer@users.noreply.github.com> Date: Sat, 29 Jan 2022 15:51:46 +0000 Subject: [PATCH] s6 overlay improvements. --- docker/Dockerfile | 8 +++++--- docker/README.md | 3 ++- docker/etc/services.d/02-avahi/run | 11 +++++++++-- docker/etc/services.d/03-nqptp/run | 2 +- docker/etc/services.d/04-shairport-sync/finish | 2 -- docker/etc/services.d/04-shairport-sync/run | 2 -- 6 files changed, 17 insertions(+), 11 deletions(-) delete mode 100644 docker/etc/services.d/04-shairport-sync/finish delete mode 100644 docker/etc/services.d/04-shairport-sync/run diff --git a/docker/Dockerfile b/docker/Dockerfile index 132699da..08e5e49b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine AS builder +FROM alpine:3.12 AS builder # Check required arguments exist. These will be provided by the Github Action # Workflow and are required to ensure the correct branches are being used. @@ -67,7 +67,7 @@ RUN make install ##### SPS END ##### # Shairport Sync Runtime System -FROM crazymax/alpine-s6:edge +FROM crazymax/alpine-s6:3.12-edge RUN apk -U add \ alsa-lib \ @@ -107,4 +107,6 @@ 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" ] \ No newline at end of file +ENTRYPOINT [ "/init" ] + +CMD /usr/local/bin/shairport-sync -vu --statistics \ No newline at end of file diff --git a/docker/README.md b/docker/README.md index 8ba67faa..408215fe 100644 --- a/docker/README.md +++ b/docker/README.md @@ -36,10 +36,11 @@ To get access to the full range of configuration options, pass the configuration ### Build Example (for arm7 devices) ``` -docker buildx build --platform linux/arm/v7 -f ./docker/Dockerfile --build-arg SHAIRPORT_SYNC_BRANCH=development --build-arg NQPTP_BRANCH=development -t shairport-sync:unstable-development . +docker buildx build --platform linux/arm/v7 -f ./docker/Dockerfile --build-arg SHAIRPORT_SYNC_BRANCH=development --build-arg NQPTP_BRANCH=development --no-cache -t shairport-sync:unstable-development . ``` `SHAIRPORT_SYNC_BRANCH` and `NQPTP_BRANCH` are required to ensure the image is built using the expected branch. +`--no-cache` needs to be used to force buildx to pull the NQPTP branch for new updates. This slows down the build time though so can be removed when it is not beneficial during testing. ### AirPlay 1 Only diff --git a/docker/etc/services.d/02-avahi/run b/docker/etc/services.d/02-avahi/run index 848dd8dd..27cd49c0 100644 --- a/docker/etc/services.d/02-avahi/run +++ b/docker/etc/services.d/02-avahi/run @@ -1,2 +1,9 @@ -#!/usr/bin/execlineb -P -avahi-daemon --no-chroot \ No newline at end of file +#!/bin/sh +avahi-daemon --check +if [ $? -eq 0 ]; then + echo "Reloading avahi-daemon." + avahi-daemon --no-chroot --reload +else + echo "Starting avahi-daemon." + avahi-daemon --no-chroot +fi \ No newline at end of file diff --git a/docker/etc/services.d/03-nqptp/run b/docker/etc/services.d/03-nqptp/run index 7ddde248..0e3e3e4c 100644 --- a/docker/etc/services.d/03-nqptp/run +++ b/docker/etc/services.d/03-nqptp/run @@ -1,2 +1,2 @@ #!/usr/bin/execlineb -P -/usr/local/bin/nqptp \ No newline at end of file +/usr/local/bin/nqptp -v \ No newline at end of file diff --git a/docker/etc/services.d/04-shairport-sync/finish b/docker/etc/services.d/04-shairport-sync/finish deleted file mode 100644 index c9e22a21..00000000 --- a/docker/etc/services.d/04-shairport-sync/finish +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/execlineb -S0 -s6-svscanctl -t /var/run/s6/services \ No newline at end of file diff --git a/docker/etc/services.d/04-shairport-sync/run b/docker/etc/services.d/04-shairport-sync/run deleted file mode 100644 index 395ff814..00000000 --- a/docker/etc/services.d/04-shairport-sync/run +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/execlineb -P -/usr/local/bin/shairport-sync -vu --statistics \ No newline at end of file