diff --git a/Dockerfile b/Dockerfile index 57a77ba..c8e47a8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ ARG BASE_IMAGE="${BASE_IMAGE:-ubuntu:noble}" FROM ${BASE_IMAGE} AS base ARG BASE_IMAGE="${BASE_IMAGE:-ubuntu:noble}" -ARG USE_PPA="${USE_PPA:-upnpp1}" ARG BUILD_MODE="${BUILD_MODE:-full}" ARG USE_APT_PROXY @@ -20,8 +19,10 @@ RUN if [ "$USE_APT_PROXY" = "Y" ]; then \ ARG DEBIAN_FRONTEND=noninteractive +RUN apt-get update +RUN apt-get install -y ca-certificates + RUN if [ "$BUILD_MODE" = "full" ]; then \ - apt-get update; \ apt-get install -y python3 python3-pip; \ fi @@ -61,8 +62,6 @@ RUN if [ "$BUILD_MODE" = "full" ]; then \ RUN apt-get install -y net-tools -RUN apt-get remove -y software-properties-common - RUN apt-get -y autoremove RUN rm -rf /var/lib/apt/lists/* diff --git a/app/install/setup-ubuntu.sh b/app/install/setup-ubuntu.sh index d9a3075..2560576 100644 --- a/app/install/setup-ubuntu.sh +++ b/app/install/setup-ubuntu.sh @@ -2,11 +2,18 @@ set -ex -echo $USE_PPA > /app/conf/ppa.txt +PPA_NAME=upnpp1 +PPA_KEY=bd1ec68cab92bbd56698f1c507971a38c8a2ca38 + +echo $PPA_NAME > /app/conf/ppa.txt apt-get update -apt-get install -y git -apt-get install -y software-properties-common -add-apt-repository ppa:jean-francois-dockes/${USE_PPA} -apt-get update +apt-get install -y gnupg +mkdir -p /etc/apt/sources.list.d -p +cp /app/install/ubuntu.${PPA_NAME}.list /etc/apt/sources.list.d/${PPA_NAME}.list +# cat /etc/apt/sources.list.d/${PPA_NAME}.list +sed -i "s/UBUNTU_VERSION/${IMAGE_VERSION}/g" /etc/apt/sources.list.d/${PPA_NAME}.list +# cat /etc/apt/sources.list.d/${PPA_NAME}.list +apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ${PPA_KEY} +apt-get update diff --git a/app/install/setup.sh b/app/install/setup.sh index bd9038c..ebf3cb0 100644 --- a/app/install/setup.sh +++ b/app/install/setup.sh @@ -8,13 +8,26 @@ IMAGE_VERSION=$(echo $BASE_IMAGE | cut -d ":" -f 2) echo "IMAGE_VERSION=[$IMAGE_VERSION]" apt-get update + +if [[ "$BASE_IMAGE" == ubuntu* ]]; then + echo "Setup for ubuntu" + . /app/install/setup-ubuntu.sh +elif [[ "$BASE_IMAGE" == debian* ]]; then + echo "Setup for debian" + . /app/install/setup-debian.sh +else + echo "BASE_IMAGE=[${BASE_IMAGE}] is not supported." + exit 1 +fi + apt-get install -y git -if [ "$BUILD_MODE" = "full" ]; then +if [[ "$BUILD_MODE" == "full" ]]; then declare -A needs_switch needs_switch[bookworm-slim]=1 needs_switch[mantic]=1 needs_switch[noble]=1 + needs_switch[oracular]=1 add_switch=0 if [[ -v needs_switch[$IMAGE_VERSION] ]]; then add_switch=${needs_switch[$IMAGE_VERSION]} @@ -42,12 +55,3 @@ if [ "$BUILD_MODE" = "full" ]; then done fi -if [[ "$BASE_IMAGE" == ubuntu* ]]; then - echo "Setup for ubuntu" - /app/install/setup-ubuntu.sh -elif [[ "$BASE_IMAGE" == debian* ]]; then - echo "Setup for debian" - /app/install/setup-debian.sh -else - exit 1 -fi diff --git a/app/install/ubuntu.upnpp1.list b/app/install/ubuntu.upnpp1.list new file mode 100644 index 0000000..02ef613 --- /dev/null +++ b/app/install/ubuntu.upnpp1.list @@ -0,0 +1,2 @@ +deb https://ppa.launchpadcontent.net/jean-francois-dockes/upnpp1/ubuntu UBUNTU_VERSION main +deb-src https://ppa.launchpadcontent.net/jean-francois-dockes/upnpp1/ubuntu UBUNTU_VERSION main \ No newline at end of file diff --git a/build.sh b/build.sh index bf61137..ecefe3b 100755 --- a/build.sh +++ b/build.sh @@ -14,7 +14,6 @@ base_images[focal]=ubuntu:focal DEFAULT_BASE_IMAGE=noble DEFAULT_TAG=local DEFAULT_USE_PROXY=N -DEFAULT_PPA=upnpp1 DEFAULT_BUILD_MODE=full DEFAULT_CACHE_MODE="" @@ -22,15 +21,12 @@ DEFAULT_CACHE_MODE="" tag=$DEFAULT_TAG use_proxy=$DEFAULT_USE_PROXY -ppa=$DEFAULT_PPA - -while getopts b:t:p:e:m:c: flag +while getopts b:t:p:m:c: flag do case "${flag}" in b) base_image=${OPTARG};; t) tag=${OPTARG};; p) proxy=${OPTARG};; - e) ppa=${OPTARG};; m) build_mode=${OPTARG};; c) cache_mode=${OPTARG};; esac @@ -39,7 +35,6 @@ done echo "base_image: $base_image"; echo "tag: $tag"; echo "proxy: $proxy"; -echo "ppa: $ppa"; echo "build_mode: $build_mode"; echo "cache_mode: $cache_mode"; @@ -70,15 +65,14 @@ fi echo "Base Image: ["$select_base_image"]" echo "Tag: ["$tag"]" -echo "PPA: ["$ppa"]" echo "Build Mode: ["$build_mode"]" echo "Proxy: ["$use_proxy"]" cmd_line="docker build . ${cache_mode} \ --build-arg BASE_IMAGE=${select_base_image} \ --build-arg USE_APT_PROXY=${use_proxy} \ - --build-arg USE_PPA=${ppa} \ --build-arg BUILD_MODE=${build_mode} \ + --progress=plain \ -t giof71/upmpdcli:$tag" echo "cmd_line=[$cmd_line]" diff --git a/doc/change-history.md b/doc/change-history.md index 950e86a..82a72a3 100644 --- a/doc/change-history.md +++ b/doc/change-history.md @@ -2,7 +2,8 @@ Change Date|Major Changes ---|--- -2024-07-21|Add support for disabling OpenHome Radio Service (see issue [#429](https://github.com/GioF71/upmpdcli-docker/issues/429)) +2024-08-24|Fix arm-only image build issue (see issue [#436](https://github.com/GioF71/upmpdcli-docker/issues/436)) +2024-08-21|Bump to upmpdcli version 1.8.6 2024-07-19|Add `SKIP_CHOWN_CACHE` to skip chown on possibly crowded /cache 2024-07-12|Add script for generating tidal oauth2 credentials (see issue [#425](https://github.com/GioF71/upmpdcli-docker/issues/425)) 2024-06-13|Automatically set ohproductroom to friendlyname if not explicitly set