s6 improvements and docker build changes

This commit is contained in:
Charles
2022-08-20 00:02:54 +01:00
parent 8629fb5c82
commit e887ccd8de
22 changed files with 106 additions and 38 deletions
+13 -11
View File
@@ -35,7 +35,7 @@ RUN apk -U add \
##### ALAC #####
RUN git clone https://github.com/mikebrady/alac
WORKDIR /alac
RUN autoreconf -fi
RUN autoreconf -i
RUN ./configure
RUN make
RUN make install
@@ -46,7 +46,7 @@ WORKDIR /
RUN git clone https://github.com/mikebrady/nqptp
WORKDIR /nqptp
RUN git checkout "$NQPTP_BRANCH"
RUN autoreconf -fi
RUN autoreconf -i
RUN ./configure
RUN make
RUN make install
@@ -57,18 +57,19 @@ WORKDIR /
WORKDIR /shairport-sync
COPY . .
RUN git checkout "$SHAIRPORT_SYNC_BRANCH"
RUN autoreconf -fi
RUN ./configure --sysconfdir=/etc --with-alsa --with-soxr --with-avahi --with-ssl=openssl --with-airplay-2 \
WORKDIR /shairport-sync/build
RUN autoreconf -i ../
RUN ../configure --sysconfdir=/etc --with-alsa --with-soxr --with-avahi --with-ssl=openssl --with-airplay-2 \
--with-metadata --with-dummy --with-pipe --with-dbus-interface \
--with-stdout --with-mpris-interface --with-mqtt-client \
--with-apple-alac --with-convolution
RUN make -j
RUN make install
RUN make -j $(nproc)
RUN DESTDIR=install make install
WORKDIR /
##### SPS END #####
# Shairport Sync Runtime System
FROM crazymax/alpine-s6:3.12-3.0.0.2
FROM crazymax/alpine-s6:3.12-3.1.1.2
RUN apk -U add \
alsa-lib \
@@ -88,13 +89,14 @@ RUN apk -U add \
libgcrypt
# Copy build files.
COPY --from=builder /usr/local/bin/shairport-sync /usr/local/bin/shairport-sync
COPY --from=builder /shairport-sync/build/install/usr/local/bin/shairport-sync /usr/local/bin/shairport-sync
COPY --from=builder /usr/local/bin/nqptp /usr/local/bin/nqptp
COPY --from=builder /usr/local/lib/libalac.* /usr/local/lib/
COPY --from=builder /etc/dbus-1/system.d/shairport-sync-dbus.conf /etc/dbus-1/system.d/
COPY --from=builder /etc/dbus-1/system.d/shairport-sync-mpris.conf /etc/dbus-1/system.d/
COPY --from=builder /shairport-sync/build/install/etc/dbus-1/system.d/shairport-sync-dbus.conf /etc/dbus-1/system.d/
COPY --from=builder /shairport-sync/build/install/etc/dbus-1/system.d/shairport-sync-mpris.conf /etc/dbus-1/system.d/
COPY ./docker/etc/s6-overlay/s6-rc.d /etc/s6-overlay/s6-rc.d
RUN chmod +x /etc/s6-overlay/s6-rc.d/startup/script.sh
# Create non-root user for running the container -- running as the user 'shairport-sync' also allows
# Shairport Sync to provide the D-Bus and MPRIS interfaces within the container
@@ -110,4 +112,4 @@ RUN rm -rf /lib/apk/db/*
ENTRYPOINT [ "/init" ]
CMD /usr/local/bin/shairport-sync -vu --statistics
CMD [ "/usr/local/bin/shairport-sync", "-v", "--statistics" ]
+1 -1
View File
@@ -44,7 +44,7 @@ docker buildx build --platform linux/arm/v7 -f ./docker/Dockerfile --build-arg S
### AirPlay 1 Only
The AirPlay1 only dockerfile is in the `airplay1` folder. This also includes the `start.sh` script used by the container. Please note that the AirPlay 1 image built via the AirPlay 2 branch has missing functionality, e.g. it does not work with multiple instances on the same hardware; does not support iTunes for Windows etc.
The AirPlay 1 only dockerfile is in the `classic` folder. This also includes the `start.sh` script used by the container. Please note that the AirPlay 1 image built via the AirPlay 2 branch has missing functionality, e.g. it does not work with multiple instances on the same hardware; does not support iTunes for Windows etc.
### GitHub Action Builds
@@ -41,7 +41,7 @@ COPY --from=builder-alac /usr/local/lib/libalac.* /usr/local/lib/
COPY --from=builder-alac /usr/local/lib/pkgconfig/alac.pc /usr/local/lib/pkgconfig/alac.pc
COPY --from=builder-alac /usr/local/include /usr/local/include
WORKDIR shairport-sync
WORKDIR /shairport-sync
COPY . .
RUN git checkout "$SHAIRPORT_SYNC_BRANCH"
RUN autoreconf -fi
@@ -80,7 +80,7 @@ RUN apk -U add \
libgcc \
libgc++
RUN rm -rf /lib/apk/db/*
RUN rm -rf /lib/apk/db/*
COPY --from=builder-alac /usr/local/lib/libalac.* /usr/local/lib/
COPY --from=builder-sps /etc/shairport-sync* /etc/
@@ -97,7 +97,7 @@ RUN adduser -D shairport-sync -G shairport-sync
# Add the shairport-sync user to the pre-existing audio group, which has ID 29, for access to the ALSA stuff
RUN addgroup -g 29 docker_audio && addgroup shairport-sync docker_audio
COPY ./docker/airplay1/start.sh /
COPY ./docker/classic/start.sh /
RUN chmod +x /start.sh
ENTRYPOINT [ "/start.sh" ]
@@ -1,3 +1,3 @@
# AirPlay 1 Only Docker Image
# Classic (AirPlay 1 Only) Docker Image
See the [Shairport Sync Docker Hub Repo](https://hub.docker.com/r/mikebrady/shairport-sync) for available tags.
@@ -0,0 +1,2 @@
#!/command/execlineb -S0
/run/s6/basedir/bin/halt
+2 -1
View File
@@ -1,3 +1,4 @@
#!/bin/sh
#!/command/with-contenv sh
rm -rf /var/run/dbus.pid
echo "Starting dbus"
exec dbus-daemon --system --nofork
@@ -0,0 +1,2 @@
#!/command/execlineb -S0
/run/s6/basedir/bin/halt
+8 -9
View File
@@ -1,9 +1,8 @@
#!/bin/sh
avahi-daemon --check
if [ $? -eq 0 ]; then
echo "Reloading avahi-daemon."
exec avahi-daemon --no-chroot --reload
else
echo "Starting avahi-daemon."
exec avahi-daemon --no-chroot
fi
#!/command/with-contenv sh
sleep 5
while [ ! -f /var/run/dbus.pid ]; do
"dbus is not running, sleeping for 5 seconds before trying to start avahi"
sleep 5
done
echo "Starting avahi"
exec avahi-daemon --no-chroot
@@ -0,0 +1,2 @@
#!/command/execlineb -S0
/run/s6/basedir/bin/halt
+2 -1
View File
@@ -1,2 +1,3 @@
#!/bin/sh
#!/command/with-contenv sh
echo "Starting nqptp"
exec /usr/local/bin/nqptp -v
@@ -0,0 +1,2 @@
#!/bin/sh
echo "STARTING - $(date)"
@@ -0,0 +1 @@
oneshot
+1
View File
@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/startup/script.sh