Skip to content

Commit 8fac880

Browse files
committed
Compile locally
1 parent ca1ccaf commit 8fac880

File tree

5 files changed

+149
-79
lines changed

5 files changed

+149
-79
lines changed

.github/workflows/docker-multi-arch.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
base: [ "noble" ]
18+
base: [ "stable" ]
1919
build_mode: ["full", "renderer"]
2020

2121
steps:
@@ -41,6 +41,7 @@ jobs:
4141
base_images[kinetic]=ubuntu:kinetic
4242
base_images[jammy]=ubuntu:jammy
4343
base_images[bookworm]=debian:bookworm-slim
44+
base_images[stable]=debian:stable-slim
4445
4546
image_name="${{secrets.DOCKER_USERNAME}}/upmpdcli"
4647

Dockerfile

+59-64
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,72 @@
1-
ARG BASE_IMAGE="${BASE_IMAGE:-ubuntu:noble}"
1+
ARG BASE_IMAGE="${BASE_IMAGE:-debian:stable-slim}"
22
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
63

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
4+
RUN apt-get update
5+
RUN apt-get -y install git build-essential
6+
RUN apt-get -y install meson
7+
RUN apt-get -y install pkg-config
8+
RUN apt-get -y install cmake
9+
RUN apt-get -y install libexpat1-dev
10+
11+
WORKDIR /build
12+
RUN git clone https://framagit.org/medoc92/npupnp.git
13+
14+
WORKDIR /build/npupnp
15+
RUN meson setup --prefix /usr build
16+
WORKDIR /build/npupnp/build
17+
RUN ninja
18+
RUN meson install
19+
20+
WORKDIR /build
21+
RUN git clone https://framagit.org/medoc92/libupnpp.git
22+
23+
WORKDIR /build/libupnpp
24+
RUN meson setup --prefix /usr build
25+
WORKDIR /build/libupnpp/build
26+
RUN ninja
27+
RUN meson install
28+
29+
WORKDIR /build
30+
RUN git clone https://framagit.org/medoc92/upmpdcli.git
31+
32+
RUN apt-get -y install libmicrohttpd-dev
33+
RUN apt-get -y install libjsoncpp-dev libmpdclient-dev
34+
35+
WORKDIR /build/upmpdcli
36+
RUN meson setup --prefix /usr build
37+
WORKDIR /build/upmpdcli/build
38+
RUN ninja
39+
RUN meson install
1940

2041
ARG DEBIAN_FRONTEND=noninteractive
21-
22-
RUN apt-get update
2342
RUN apt-get install -y ca-certificates
43+
RUN apt-get -y install bash
44+
RUN apt-get -y install curl
45+
RUN apt-get -y install net-tools
2446

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
47+
ARG BUILD_MODE=full
6448

65-
RUN apt-get -y autoremove
66-
RUN rm -rf /var/lib/apt/lists/*
49+
WORKDIR /install
50+
COPY app/install/setup-media-server.sh /install/setup-media-server.sh
51+
RUN chmod +x /install/setup-media-server.sh
52+
RUN /install/setup-media-server.sh
53+
# RUN if [ "${BUILD_MODE}" == "full" ]; then /bin/sh -c /install/setup-media-server.sh; fi
6754

68-
RUN if [ "$USE_APT_PROXY" = "Y" ]; then \
69-
rm /etc/apt/apt.conf.d/01proxy; \
70-
fi
7155

72-
RUN rm -Rf /app/install
56+
# RUN apt-get -y install python3
57+
# RUN apt-get -y install python3-pip
58+
# RUN pip install --break-system-packages subsonic-connector
59+
# RUN pip install --break-system-packages tidalapi
60+
# RUN pip install --break-system-packages pyradios
61+
# libmpdclient2 libjsoncpp25
62+
# RUN apt-get -y install expat
63+
64+
RUN apt-get -y remove pkg-config meson cmake build-essential
65+
RUN apt-get -y remove libexpat1-dev
66+
RUN apt-get -y autoremove
67+
RUN rm -Rf /var/lib/apt/lists/*
7368

74-
RUN echo $BUILD_MODE > /app/conf/build_mode.txt
69+
RUN rm -Rf /build
7570

7671
FROM scratch
7772
COPY --from=base / /

Dockerfile-localbuild

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
ARG BASE_IMAGE="${BASE_IMAGE:-debian:stable-slim}"
2+
FROM ${BASE_IMAGE} AS base
3+
4+
RUN apt-get update
5+
RUN apt-get -y install git build-essential
6+
RUN apt-get -y install meson
7+
RUN apt-get -y install pkg-config
8+
RUN apt-get -y install cmake
9+
RUN apt-get -y install libexpat1-dev
10+
11+
WORKDIR /build
12+
RUN git clone https://framagit.org/medoc92/npupnp.git
13+
14+
WORKDIR /build/npupnp
15+
RUN meson setup --prefix /usr build
16+
WORKDIR /build/npupnp/build
17+
RUN ninja
18+
RUN meson install
19+
20+
WORKDIR /build
21+
RUN git clone https://framagit.org/medoc92/libupnpp.git
22+
23+
WORKDIR /build/libupnpp
24+
RUN meson setup --prefix /usr build
25+
WORKDIR /build/libupnpp/build
26+
RUN ninja
27+
RUN meson install
28+
29+
WORKDIR /build
30+
RUN git clone https://framagit.org/medoc92/upmpdcli.git
31+
32+
RUN apt-get -y install libmicrohttpd-dev
33+
RUN apt-get -y install libjsoncpp-dev libmpdclient-dev
34+
35+
WORKDIR /build/upmpdcli
36+
RUN meson setup --prefix /usr build
37+
WORKDIR /build/upmpdcli/build
38+
RUN ninja
39+
RUN meson install
40+
41+
ARG DEBIAN_FRONTEND=noninteractive
42+
RUN apt-get install -y ca-certificates
43+
RUN apt-get -y install bash
44+
RUN apt-get -y install curl
45+
RUN apt-get -y install net-tools
46+
47+
ARG BUILD_MODE=full
48+
49+
WORKDIR /install
50+
COPY app/install/setup-media-server.sh /install/setup-media-server.sh
51+
RUN chmod +x /install/setup-media-server.sh
52+
RUN /install/setup-media-server.sh
53+
# RUN if [ "${BUILD_MODE}" == "full" ]; then /bin/sh -c /install/setup-media-server.sh; fi
54+
55+
56+
# RUN apt-get -y install python3
57+
# RUN apt-get -y install python3-pip
58+
# RUN pip install --break-system-packages subsonic-connector
59+
# RUN pip install --break-system-packages tidalapi
60+
# RUN pip install --break-system-packages pyradios
61+
# libmpdclient2 libjsoncpp25
62+
# RUN apt-get -y install expat
63+
64+
RUN apt-get -y remove pkg-config meson cmake build-essential
65+
RUN apt-get -y remove libexpat1-dev
66+
RUN apt-get -y autoremove
67+
RUN rm -Rf /var/lib/apt/lists/*
68+
69+
RUN rm -Rf /build
70+
71+
FROM scratch
72+
COPY --from=base / /

app/install/setup-media-server.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
3+
echo "BUILD_MODE=[${BUILD_MODE}]"
4+
5+
if [ "${BUILD_MODE}" = "full" ]; then
6+
apt-get -y install curl python3
7+
apt-get -y install curl exiftool
8+
apt-get -y install curl recollcmd
9+
apt-get -y install python3-pip
10+
pip install --break-system-packages subsonic-connector
11+
pip install --break-system-packages tidalapi
12+
pip install --break-system-packages pyradios
13+
fi

build.sh

+3-14
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
declare -A base_images
44

5+
base_images[stable]=debian:stable-slim
56
base_images[bookworm]=debian:bookworm-slim
67
base_images[bullseye]=debian:bullseye-slim
78
base_images[noble]=ubuntu:noble
@@ -11,43 +12,33 @@ base_images[kinetic]=ubuntu:kinetic
1112
base_images[jammy]=ubuntu:jammy
1213
base_images[focal]=ubuntu:focal
1314

14-
DEFAULT_BASE_IMAGE=noble
15+
DEFAULT_BASE_IMAGE=stable
1516
DEFAULT_TAG=local
16-
DEFAULT_USE_PROXY=N
1717
DEFAULT_BUILD_MODE=full
1818

1919
DEFAULT_CACHE_MODE=""
2020

2121
tag=$DEFAULT_TAG
22-
use_proxy=$DEFAULT_USE_PROXY
2322

24-
while getopts b:t:p:m:c: flag
23+
while getopts b:t:m:c: flag
2524
do
2625
case "${flag}" in
2726
b) base_image=${OPTARG};;
2827
t) tag=${OPTARG};;
29-
p) proxy=${OPTARG};;
3028
m) build_mode=${OPTARG};;
3129
c) cache_mode=${OPTARG};;
3230
esac
3331
done
3432

3533
echo "base_image: $base_image";
3634
echo "tag: $tag";
37-
echo "proxy: $proxy";
3835
echo "build_mode: $build_mode";
3936
echo "cache_mode: $cache_mode";
4037

4138
if [ -z "${base_image}" ]; then
4239
base_image=$DEFAULT_BASE_IMAGE
4340
fi
4441

45-
if [ -z "${proxy}" ]; then
46-
use_proxy="N"
47-
else
48-
use_proxy=$proxy
49-
fi
50-
5142
if [[ -z ${base_images[$base_image]} ]]; then
5243
echo "Image for ["$base_image"] not found"
5344
select_base_image=${base_images[$DEFAULT_BASE_IMAGE]}
@@ -66,11 +57,9 @@ fi
6657
echo "Base Image: ["$select_base_image"]"
6758
echo "Tag: ["$tag"]"
6859
echo "Build Mode: ["$build_mode"]"
69-
echo "Proxy: ["$use_proxy"]"
7060

7161
cmd_line="docker build . ${cache_mode} \
7262
--build-arg BASE_IMAGE=${select_base_image} \
73-
--build-arg USE_APT_PROXY=${use_proxy} \
7463
--build-arg BUILD_MODE=${build_mode} \
7564
--progress=plain \
7665
-t giof71/upmpdcli:$tag"

0 commit comments

Comments
 (0)