|
1 |
| -ARG BASE_IMAGE="${BASE_IMAGE:-ubuntu:noble}" |
| 1 | +ARG BASE_IMAGE="${BASE_IMAGE:-debian:stable-slim}" |
2 | 2 | FROM ${BASE_IMAGE} AS base
|
3 |
| -ARG BASE_IMAGE="${BASE_IMAGE:-ubuntu:noble}" |
4 |
| -ARG BUILD_MODE="${BUILD_MODE:-full}" |
5 |
| -ARG USE_APT_PROXY |
6 |
| - |
7 |
| -RUN mkdir -p /app/conf |
8 |
| -RUN mkdir -p /app/install |
9 |
| - |
10 |
| -COPY app/conf/01proxy /app/conf/ |
11 |
| - |
12 |
| -RUN if [ "$USE_APT_PROXY" = "Y" ]; then \ |
13 |
| - echo "Using apt proxy"; \ |
14 |
| - cp /app/conf/01proxy /etc/apt/apt.conf.d/01proxy; \ |
15 |
| - echo /etc/apt/apt.conf.d/01proxy; \ |
16 |
| - else \ |
17 |
| - echo "Building without proxy"; \ |
18 |
| - fi |
19 | 3 |
|
20 | 4 | ARG DEBIAN_FRONTEND=noninteractive
|
21 |
| - |
22 | 5 | RUN apt-get update
|
23 |
| -RUN apt-get install -y ca-certificates |
24 |
| - |
25 |
| -RUN if [ "$BUILD_MODE" = "full" ]; then \ |
26 |
| - apt-get install -y python3 python3-pip; \ |
27 |
| - fi |
28 |
| - |
29 |
| -COPY app/install/* /app/install/ |
30 |
| -RUN chmod u+x /app/install/*.sh |
31 |
| -RUN /app/install/setup.sh |
32 |
| - |
33 |
| -RUN apt-get install -y upmpdcli |
34 |
| -RUN apt-get install -y --no-install-recommends iproute2 grep |
35 |
| - |
36 |
| -RUN if [ "$BUILD_MODE" = "full" ]; then \ |
37 |
| - apt-get install -y \ |
38 |
| - upmpdcli-bbc \ |
39 |
| - upmpdcli-hra \ |
40 |
| - upmpdcli-qobuz \ |
41 |
| - upmpdcli-radio-browser \ |
42 |
| - upmpdcli-radio-paradise \ |
43 |
| - upmpdcli-mother-earth-radio \ |
44 |
| - upmpdcli-radios \ |
45 |
| - upmpdcli-subsonic \ |
46 |
| - upmpdcli-tidal \ |
47 |
| - upmpdcli-uprcl; \ |
48 |
| - fi |
49 |
| - |
50 |
| -RUN if [ "$BUILD_MODE" = "full" ]; then \ |
51 |
| - apt-get install -y \ |
52 |
| - recollcmd; \ |
53 |
| - fi |
54 |
| - |
55 |
| -RUN if [ "$BUILD_MODE" = "full" ]; then \ |
56 |
| - apt-get install -y exiftool; \ |
57 |
| - fi |
58 |
| - |
59 |
| -RUN if [ "$BUILD_MODE" = "full" ]; then \ |
60 |
| - apt-get install -y git; \ |
61 |
| - fi |
62 |
| - |
63 |
| -RUN apt-get install -y net-tools |
64 | 6 |
|
| 7 | +RUN apt-get -y install \ |
| 8 | + ca-certificates \ |
| 9 | + bash \ |
| 10 | + curl \ |
| 11 | + net-tools \ |
| 12 | + iproute2 \ |
| 13 | + grep \ |
| 14 | + git \ |
| 15 | + build-essential \ |
| 16 | + meson \ |
| 17 | + pkg-config \ |
| 18 | + cmake \ |
| 19 | + libexpat1-dev \ |
| 20 | + libmicrohttpd-dev \ |
| 21 | + libjsoncpp-dev \ |
| 22 | + libmpdclient-dev |
| 23 | + |
| 24 | +# create build directory |
| 25 | +WORKDIR /build |
| 26 | + |
| 27 | +# build npupnp |
| 28 | +RUN git clone https://framagit.org/medoc92/npupnp.git |
| 29 | +WORKDIR /build/npupnp |
| 30 | +RUN meson setup --prefix /usr build |
| 31 | +WORKDIR /build/npupnp/build |
| 32 | +RUN ninja |
| 33 | +RUN meson install |
| 34 | + |
| 35 | +# build libupnpp |
| 36 | +WORKDIR /build |
| 37 | +RUN git clone https://framagit.org/medoc92/libupnpp.git |
| 38 | +WORKDIR /build/libupnpp |
| 39 | +RUN meson setup --prefix /usr build |
| 40 | +WORKDIR /build/libupnpp/build |
| 41 | +RUN ninja |
| 42 | +RUN meson install |
| 43 | + |
| 44 | +# build upmpdcli |
| 45 | +ARG BRANCH_NAME=upmpdcli-v1.9.3 |
| 46 | +RUN echo "Using branch [${BRANCH_NAME}}] for upmpdcli ..." |
| 47 | +WORKDIR /build |
| 48 | +RUN git clone --depth 1 --branch ${BRANCH_NAME} https://framagit.org/medoc92/upmpdcli.git |
| 49 | + |
| 50 | +WORKDIR /build/upmpdcli |
| 51 | +RUN meson setup --prefix /usr build |
| 52 | +WORKDIR /build/upmpdcli/build |
| 53 | +RUN ninja |
| 54 | +RUN meson install |
| 55 | + |
| 56 | +ARG BUILD_MODE=full |
| 57 | + |
| 58 | +WORKDIR /install |
| 59 | +COPY app/install/* /install/ |
| 60 | +RUN chmod +x /install/*.sh |
| 61 | +RUN if [ "${BUILD_MODE}" = "full" ]; then /bin/sh -c /install/mediaserver-libraries.sh; fi |
| 62 | +RUN if [ "${BUILD_MODE}" = "full" ]; then /bin/sh -c /install/mediaserver-python-packages.sh; fi |
| 63 | + |
| 64 | +RUN apt-get -y remove pkg-config meson cmake build-essential libexpat1-dev |
65 | 65 | RUN apt-get -y autoremove
|
66 |
| -RUN rm -rf /var/lib/apt/lists/* |
67 |
| - |
68 |
| -RUN if [ "$USE_APT_PROXY" = "Y" ]; then \ |
69 |
| - rm /etc/apt/apt.conf.d/01proxy; \ |
70 |
| - fi |
71 |
| - |
72 |
| -RUN rm -Rf /app/install |
73 |
| - |
74 |
| -RUN echo $BUILD_MODE > /app/conf/build_mode.txt |
| 66 | +RUN rm -Rf /var/lib/apt/lists/* |
| 67 | +RUN rm -Rf /build |
75 | 68 |
|
76 | 69 | FROM scratch
|
77 | 70 | COPY --from=base / /
|
|
0 commit comments