forked from mikebrady/shairport-sync-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
101 lines (85 loc) · 2.83 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
FROM alpine:3.12 AS builder-base
# General Build System:
RUN apk -U add \
git \
build-base \
autoconf \
automake \
libtool \
dbus \
su-exec \
alsa-lib-dev \
libdaemon-dev \
popt-dev \
mbedtls-dev \
soxr-dev \
avahi-dev \
libconfig-dev \
libsndfile-dev \
mosquitto-dev \
xmltoman
# ALAC Build System:
FROM builder-base AS builder-alac
RUN git clone https://github.com/mikebrady/alac
WORKDIR alac
RUN autoreconf -fi
RUN ./configure
RUN make
RUN make install
# Shairport Sync Build System:
FROM builder-base AS builder-sps
# This may be modified by the Github Action Workflow.
ARG SHAIRPORT_SYNC_BRANCH=master
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
RUN git clone https://github.com/mikebrady/shairport-sync
WORKDIR shairport-sync
RUN git checkout "$SHAIRPORT_SYNC_BRANCH"
RUN autoreconf -fi
RUN ./configure \
--with-alsa \
--with-dummy \
--with-pipe \
--with-stdout \
--with-avahi \
--with-ssl=mbedtls \
--with-soxr \
--sysconfdir=/etc \
--with-dbus-interface \
--with-mpris-interface \
--with-mqtt-client \
--with-apple-alac \
--with-convolution
RUN make -j $(nproc)
RUN make install
# Shairport Sync Runtime System:
FROM alpine:3.12
RUN apk -U add \
alsa-lib \
dbus \
popt \
glib \
mbedtls \
soxr \
avahi \
libconfig \
libsndfile \
mosquitto-libs \
su-exec \
libgcc \
libgc++
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/
COPY --from=builder-sps /etc/dbus-1/system.d/shairport-sync-dbus.conf /etc/dbus-1/system.d/
COPY --from=builder-sps /etc/dbus-1/system.d/shairport-sync-mpris.conf /etc/dbus-1/system.d/
COPY --from=builder-sps /usr/local/bin/shairport-sync /usr/local/bin/shairport-sync
# 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
RUN addgroup shairport-sync
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 start.sh /
ENTRYPOINT [ "/start.sh" ]