forked from kevineye/docker-shairport-sync
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
83 lines (69 loc) · 2.09 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
FROM alpine:3.12 AS builder
MAINTAINER [email protected]
# Deliberately version agnostic - override this arg at build time
ARG SHAIRPORT_VER=x.x.x
RUN apk --no-cache -U add \
git \
build-base \
autoconf \
automake \
libtool \
alsa-lib-dev \
libdaemon-dev \
popt-dev \
libressl-dev \
soxr-dev \
avahi-dev \
libconfig-dev \
libsndfile-dev \
mosquitto-dev
RUN mkdir /tmp/shairport-sync \
&& git clone --recursive --depth 1 --branch ${SHAIRPORT_VER} \
git://github.com/mikebrady/shairport-sync \
/tmp/shairport-sync
WORKDIR /tmp/shairport-sync
RUN autoreconf -i -f \
&& ./configure \
--with-alsa \
--with-pipe \
--with-avahi \
--with-ssl=openssl \
--with-soxr \
--with-metadata \
--sysconfdir=/etc \
--without-libdaemon \
--with-dbus-interface \
--with-mqtt-client \
--with-convolution \
&& make -j $(nproc) \
&& make install
FROM alpine:3.12
RUN apk add --no-cache \
alsa-lib \
libdaemon \
dbus \
popt \
glib \
libressl \
soxr \
avahi \
libconfig \
libsndfile \
mosquitto-libs \
su-exec \
&& rm -rf \
/etc/ssl \
/lib/apk/db/* \
/root/shairport-sync
COPY --from=builder /etc/shairport-sync* /etc/
COPY --from=builder /etc/dbus-1/system.d/shairport-sync-dbus.conf /etc/dbus-1/system.d/
COPY --from=builder /usr/local/bin/shairport-sync /usr/local/bin/shairport-sync
# Create non-root user for running the container
RUN addgroup shairport-sync && adduser -D shairport-sync -G shairport-sync
# Define the rpi's audio group (and corresponding GID) so that the running container can
# access the necessary devices
RUN addgroup -g 29 audiorpi && addgroup shairport-sync audiorpi
COPY docker-entrypoint.sh /
ENV AIRPLAY_NAME "%h (Shairport-Sync %v)"
ENTRYPOINT [ "/docker-entrypoint.sh" ]
CMD ["-v"]