# Remove anything we don't need.
RUN rm -rf /lib/apk/db/*
+
+# Add run script that will start SPS
+COPY ./docker/run.sh ./run.sh
+RUN chmod +x /run.sh
+
+Entrypoint ["/init","./run.sh"]
### Options
-To pass command line options to Shairport Sync they need to be set with `-e ARG=`. Here is an example:
+Command line options will be passed to Shairport Sync. Here is an example:
```
$ docker run -d --restart unless-stopped --net host --device /dev/snd \
- -e ARG="-v --statistics -a DenSystem -d hw:0 -c PCM" \
- mikebrady/shairport-sync:latest
+ mikebrady/shairport-sync:latest \
+ -v --statistics -a DenSystem -d hw:0 -c PCM
```
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.
# Remove anything we don't need.
RUN rm -rf /lib/apk/db/*
+
+# Add run script that will start SPS
+COPY ./docker/run.sh ./run.sh
+RUN chmod +x /run.sh
+
+Entrypoint ["/init","./run.sh"]
#!/command/with-contenv sh
while [ ! -f /var/run/dbus/dbus.pid ]; do
- echo "s6-rc: warning: dbus is not running, sleeping for 1 seconds before trying to start avahi"
+ echo "s6-rc: warning: dbus is not running, sleeping for 1 second before trying to start avahi"
sleep 1
done
echo "Starting avahi"
+++ /dev/null
-#!/command/execlineb -S0
-/run/s6/basedir/bin/halt
+++ /dev/null
-#!/command/with-contenv sh
-while [ ! -f /var/run/avahi-daemon/pid ]; do
- echo "s6-rc: warning: avahi is not running, sleeping for 1 seconds before trying to start shairport-sync"
- sleep 1
-done
-echo "Starting shairport-sync"
-exec /usr/local/bin/shairport-sync $ARG
--- /dev/null
+#!/bin/sh
+while [ ! -f /var/run/avahi-daemon/pid ]; do
+ echo "Warning: avahi is not running, sleeping for 1 second before trying to start shairport-sync"
+ sleep 1
+done
+echo "Starting shairport-sync"
+# pass all commandline options to shairport-sync
+/usr/local/bin/shairport-sync "$@"
#!/command/with-contenv sh
while [ ! -f /var/run/dbus/dbus.pid ]; do
- echo "s6-rc: warning: dbus is not running, sleeping for 1 seconds before trying to start avahi"
+ echo "s6-rc: warning: dbus is not running, sleeping for 1 second before trying to start avahi"
sleep 1
done
echo "Starting avahi"
+++ /dev/null
-#!/command/execlineb -S0
-/run/s6/basedir/bin/halt
+++ /dev/null
-#!/command/with-contenv sh
-while [ ! -f /var/run/avahi-daemon/pid ]; do
- echo "s6-rc: warning: avahi is not running, sleeping for 1 seconds before trying to start shairport-sync"
- sleep 1
-done
-echo "Starting shairport-sync"
-exec /usr/local/bin/shairport-sync $ARG
--- /dev/null
+#!/bin/sh
+while [ ! -f /var/run/avahi-daemon/pid ]; do
+ echo "Warning: avahi is not running, sleeping for 1 second before trying to start shairport-sync"
+ sleep 1
+done
+echo "Starting shairport-sync"
+# pass all commandline options to shairport-sync
+/usr/local/bin/shairport-sync "$@"