Skip to content

Commit 74a7fdb

Browse files
authored
[Maintenance] Wrong base image selection #251 (#252)
1 parent ca46323 commit 74a7fdb

File tree

4 files changed

+66
-17
lines changed

4 files changed

+66
-17
lines changed

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

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,20 @@ jobs:
3434
distro_id=${{ matrix.base }}
3535
image_name=${{secrets.DOCKER_USERNAME}}/mpd-alsa
3636
37+
declare -A mpd_compiler_base_images
38+
mpd_compiler_base_images[bullseye]="giof71/mpd-compiler:bullseye"
39+
mpd_compiler_base_images[jammy]="giof71/mpd-compiler:jammy"
40+
mpd_compiler_base_images[kinetic]="giof71/mpd-compiler:kinetic"
41+
42+
select_compiler_image=${mpd_compiler_base_images[${{ matrix.base }}]}
43+
44+
declare -A libfmt_dict
45+
libfmt_dict[bullseye]=libfmt7
46+
libfmt_dict[jammy]=libfmt-dev
47+
libfmt_dict[kinetic]=libfmt-dev
48+
49+
select_libfmt_package_name=${libfmt_dict[${{ matrix.base }}]}
50+
3751
declare -A base_image_from_matrix
3852
base_image_from_matrix[bookworm]=debian:bookworm-slim
3953
base_image_from_matrix[buster]=debian:buster-slim
@@ -108,7 +122,9 @@ jobs:
108122
fi
109123
echo "Building tags: ["${tags}"]"
110124
echo "RELEASE_TAGS=${tags}" >> $GITHUB_ENV
111-
echo "BASE_IMAGE=${base_image}" >> $GITHUB_ENV
125+
echo "BASE_IMAGE=${select_compiler_image}" >> $GITHUB_ENV
126+
echo "INTEGER_UPSAMPLING_SUPPORT=yes" >> $GITHUB_ENV
127+
echo "LIBFMT_PACKAGE_NAME=${select_libfmt_package_name}" >> $GITHUB_ENV
112128
113129
- name: Set up QEMU
114130
uses: docker/setup-qemu-action@v2
@@ -131,6 +147,8 @@ jobs:
131147
context: .
132148
build-args: |
133149
BASE_IMAGE=${{ env.BASE_IMAGE }}
150+
INTEGER_UPSAMPLING_SUPPORT=${{ env.INTEGER_UPSAMPLING_SUPPORT }}
151+
LIBFMT_PACKAGE_NAME=${{ env.LIBFMT_PACKAGE_NAME }}
134152
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
135153
push: true
136154
tags: ${{ env.RELEASE_TAGS }}

Dockerfile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
1-
ARG BASE_IMAGE_TAG="${BASE_IMAGE_TAG:-bullseye-slim}"
2-
FROM giof71/mpd-compiler:${BASE_IMAGE_TAG} AS BASE
1+
ARG BASE_IMAGE="${BASE_IMAGE}"
2+
#FROM giof71/mpd-compiler:${BASE_IMAGE_TAG} AS BASE
3+
FROM ${BASE_IMAGE} AS BASE
34

5+
ARG INTEGER_UPSAMPLING_SUPPORT="${INTEGER_UPSAMPLING_SUPPORT:-no}"
46
ARG USE_APT_PROXY
7+
ARG LIBFMT_PACKAGE_NAME
58

69
RUN mkdir -p /app/conf
710

8-
COPY app/conf/01-apt-proxy /app/conf/
9-
1011
RUN echo "USE_APT_PROXY=["${USE_APT_PROXY}"]"
12+
RUN echo "INTEGER_UPSAMPLING_SUPPORT=["${INTEGER_UPSAMPLING_SUPPORT}"]"
13+
RUN echo "LIBFMT_PACKAGE_NAME=["${LIBFMT_PACKAGE_NAME}"]"
14+
15+
RUN echo $INTEGER_UPSAMPLING_SUPPORT > /app/conf/integer_upsampling_support.txt
16+
17+
COPY app/conf/01-apt-proxy /app/conf/
1118

1219
RUN if [ "${USE_APT_PROXY}" = "Y" ]; then \
1320
echo "Builind using apt proxy"; \
@@ -25,7 +32,7 @@ RUN apt-get install -y --no-install-recommends alsa-utils
2532
RUN apt-get install -y --no-install-recommends libasound2-plugin-equal
2633
RUN apt-get install -y --no-install-recommends pulseaudio-utils
2734
RUN apt-get install -y --no-install-recommends mpdscribble
28-
RUN apt-get install -y --no-install-recommends libfmt7
35+
RUN apt-get install -y --no-install-recommends $LIBFMT_PACKAGE_NAME
2936
RUN apt-get install -y --no-install-recommends libsidplay2
3037
RUN apt-get install -y --no-install-recommends libsidutils0
3138
RUN apt-get install -y --no-install-recommends libresid-builder-dev

build.sh

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,19 @@
66

77
declare -A base_image_tags
88

9-
base_image_tags[bookworm]=bookworm-slim
10-
base_image_tags[buster]=buster-slim
11-
base_image_tags[bullseye]=bullseye-slim
12-
base_image_tags[jammy]=jammy
13-
base_image_tags[kinetic]=kinetic
14-
base_image_tags[focal]=focal
15-
base_image_tags[bionic]=bionic
9+
base_image_tags[bullseye]=giof71/mpd-compiler:bullseye
10+
base_image_tags[jammy]=giof71/mpd-compiler:jammy
11+
base_image_tags[kinetic]=giof71/mpd-compiler:kinetic
12+
13+
declare -A integer_upsampling_support_dict
14+
integer_upsampling_support_dict[bullseye]=yes
15+
integer_upsampling_support_dict[jammy]=yes
16+
integer_upsampling_support_dict[kinetic]=yes
17+
18+
declare -A libfmt_dict
19+
libfmt_dict[bullseye]=libfmt7
20+
libfmt_dict[jammy]=libfmt-dev
21+
libfmt_dict[kinetic]=libfmt-dev
1622

1723
DEFAULT_BASE_IMAGE=bullseye
1824
DEFAULT_TAG=local
@@ -44,6 +50,19 @@ if [ -z "${selected_image_tag}" ]; then
4450
exit 2
4551
fi
4652

53+
integer_upsampling_support=${integer_upsampling_support_dict[$base_image_tag]}
54+
if [ -z "${integer_upsampling_support}" ]; then
55+
echo "Integer upsampling support table entry missing for ["${base_image_tag}"]"
56+
exit 2
57+
fi
58+
59+
libfmt_package_name=${libfmt_dict[$base_image_tag]}
60+
if [ -z "${libfmt_package_name}" ]; then
61+
echo "LibFmt package table entry missing for ["${base_image_tag}"]"
62+
exit 2
63+
fi
64+
65+
4766
if [ -z "${proxy}" ]; then
4867
proxy="N"
4968
fi
@@ -60,11 +79,15 @@ if [ -z "${git_branch}" ]; then
6079
git_branch="${DEFAULT_GIT_VERSION}"
6180
fi
6281

63-
echo "Base Image Tag: ["$selected_image_tag"]"
64-
echo "Build Tag: ["$tag"]"
65-
echo "Proxy: ["$proxy"]"
82+
echo "Base Image Tag: [$selected_image_tag]"
83+
echo "Integer Upsampling support: [$integer_upsampling_support]"
84+
echo "Package name libfmt: [$libfmt_package_name]"
85+
echo "Build Tag: [$tag]"
86+
echo "Proxy: [$proxy]"
6687

6788
docker build . \
68-
--build-arg BASE_IMAGE_TAG=${selected_image_tag} \
89+
--build-arg BASE_IMAGE=${selected_image_tag} \
6990
--build-arg USE_APT_PROXY=${proxy} \
91+
--build-arg INTEGER_UPSAMPLING_SUPPORT=${integer_upsampling_support} \
92+
--build-arg LIBFMT_PACKAGE_NAME=${libfmt_package_name} \
7093
-t giof71/mpd-alsa:$tag

doc/change-history.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
Date|Major Changes
44
:---|:---
5+
2023-03-20|Fixed build base image (see issue [#251](https://github.com/GioF71/mpd-alsa-docker/issues/251) issue)
56
2023-03-06|Mentioning mpdscribble version in `README.doc`
67
2023-03-06|Add `kinetic` build and set to latest
78
2023-02-11|Dropped `OUTPUT_MODE` (including *deprecated* `ALSA` mode)

0 commit comments

Comments
 (0)