Skip to content

Commit 2a36cee

Browse files
authored
[Feature] Build vanilla mpd images #272 (#273)
1 parent dc06c2c commit 2a36cee

File tree

6 files changed

+109
-85
lines changed

6 files changed

+109
-85
lines changed

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

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
base: ["bullseye", "bookworm"]
18+
base: ["bookworm", "bullseye", "vanilla-bookworm", "vanilla-bullseye"]
1919

2020
steps:
2121
- name: Checkout
@@ -34,32 +34,42 @@ 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[bookworm]="giof71/mpd-compiler:bookworm"
37+
declare -A base_images_dict
38+
base_images_dict[bookworm]="giof71/mpd-compiler:bookworm"
39+
base_images_dict[bullseye]="giof71/mpd-compiler:bullseye"
40+
base_images_dict[buster]="giof71/mpd-compiler:buster"
41+
base_images_dict[vanilla-bookworm]="debian:bookworm-slim"
42+
base_images_dict[vanilla-bullseye]="debian:bullseye-slim"
43+
base_images_dict[vanilla-buster]="debian:buster-slim"
4044
41-
select_compiler_image=${mpd_compiler_base_images[${{ matrix.base }}]}
45+
select_base_image=${base_images_dict[${{ matrix.base }}]}
4246
43-
declare -A libfmt_dict
44-
libfmt_dict[bullseye]=libfmt7
45-
libfmt_dict[bookworm]=libfmt9
46-
47-
select_libfmt_package_name=${libfmt_dict[${{ matrix.base }}]}
48-
49-
declare -A base_image_from_matrix
50-
base_image_from_matrix[bookworm]=debian:bookworm-slim
51-
base_image_from_matrix[bullseye]=debian:bullseye-slim
52-
base_image_from_matrix[buster]=debian:buster-slim
47+
declare -A upstream_image_from_matrix
48+
upstream_image_from_matrix[bookworm]=debian:bookworm-slim
49+
upstream_image_from_matrix[bullseye]=debian:bullseye-slim
50+
upstream_image_from_matrix[buster]=debian:buster-slim
51+
upstream_image_from_matrix[vanilla-bookworm]=debian:bookworm-slim
52+
upstream_image_from_matrix[vanilla-bullseye]=debian:bullseye-slim
53+
upstream_image_from_matrix[vanilla-buster]=debian:buster-slim
5354
5455
declare -A special_tags
55-
special_tags[bullseye]="${image_name}:stable,${image_name}:latest"
5656
special_tags[bookworm]="${image_name}:edge"
57+
special_tags[bullseye]="${image_name}:stable,${image_name}:latest"
5758
special_tags[buster]="${image_name}:legacy,${image_name}:old-stable"
59+
special_tags[vanilla-bookworm]="${image_name}:vanilla-edge"
60+
special_tags[vanilla-bullseye]="${image_name}:vanilla-stable,${image_name}:vanila-latest,${image_name}:vanila"
61+
special_tags[vanilla-buster]="${image_name}:vanilla-legacy,${image_name}:vanilla-old-stable"
5862
59-
base_image=${base_image_from_matrix[${{ matrix.base }}]}
63+
declare -A mpd_version_dict
64+
mpd_version_dict[bookworm]=0.23.12
65+
mpd_version_dict[bullseye]=0.23.12
66+
mpd_version_dict[buster]=0.23.12
67+
mpd_version_dict[vanilla-bookworm]=0.23.12
68+
mpd_version_dict[vanilla-bullseye]=0.22.6
69+
mpd_version_dict[vanilla-buster]=0.21.5
6070
61-
# mpd version is 0.23.12 (compiled)
62-
mpd_version=0.23.12
71+
# select mpd version
72+
mpd_version=${mpd_version_dict["${distro_id}"]};
6373
6474
tags=""
6575
if [ "${ref_type}" = "branch" ]; then
@@ -112,9 +122,8 @@ jobs:
112122
fi
113123
echo "Building tags: ["${tags}"]"
114124
echo "RELEASE_TAGS=${tags}" >> $GITHUB_ENV
115-
echo "BASE_IMAGE=${select_compiler_image}" >> $GITHUB_ENV
125+
echo "BASE_IMAGE=${select_base_image}" >> $GITHUB_ENV
116126
echo "INTEGER_UPSAMPLING_SUPPORT=yes" >> $GITHUB_ENV
117-
echo "LIBFMT_PACKAGE_NAME=${select_libfmt_package_name}" >> $GITHUB_ENV
118127
119128
- name: Set up QEMU
120129
uses: docker/setup-qemu-action@v2
@@ -138,7 +147,6 @@ jobs:
138147
build-args: |
139148
BASE_IMAGE=${{ env.BASE_IMAGE }}
140149
INTEGER_UPSAMPLING_SUPPORT=${{ env.INTEGER_UPSAMPLING_SUPPORT }}
141-
LIBFMT_PACKAGE_NAME=${{ env.LIBFMT_PACKAGE_NAME }}
142150
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8
143151
push: true
144152
tags: ${{ env.RELEASE_TAGS }}

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

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
base: ["jammy", "kinetic"]
18+
base: ["kinetic", "jammy", "vanilla-kinetic", "vanilla-jammy"]
1919

2020
steps:
2121
- name: Checkout
@@ -34,36 +34,34 @@ 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"
37+
declare -A base_images_dict
38+
base_images_dict[kinetic]="giof71/mpd-compiler:kinetic"
39+
base_images_dict[jammy]="giof71/mpd-compiler:jammy"
40+
base_images_dict[vanilla-kinetic]="ubuntu:kinetic"
41+
base_images_dict[vanilla-jammy]="ubuntu:jammy"
4142
42-
select_compiler_image=${mpd_compiler_base_images[${{ matrix.base }}]}
43+
select_base_image=${base_images_dict[${{ matrix.base }}]}
4344
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-
51-
declare -A base_image_from_matrix
52-
base_image_from_matrix[bionic]=ubuntu:bionic
53-
base_image_from_matrix[focal]=ubuntu:focal
54-
base_image_from_matrix[jammy]=ubuntu:jammy
55-
base_image_from_matrix[kinetic]=ubuntu:kinetic
45+
declare -A upstream_image_from_matrix
46+
upstream_image_from_matrix[kinetic]=ubuntu:kinetic
47+
upstream_image_from_matrix[jammy]=ubuntu:jammy
48+
upstream_image_from_matrix[vanilla-kinetic]=ubuntu:kinetic
49+
upstream_image_from_matrix[vanilla-jammy]=ubuntu:jammy
5650
5751
declare -A special_tags
58-
special_tags[bionic]="${image_name}:ubuntu-old-lts"
59-
special_tags[focal]="${image_name}:ubuntu-previous-lts"
60-
special_tags[jammy]="${image_name}:ubuntu-current-lts"
6152
special_tags[kinetic]="${image_name}:ubuntu-current"
53+
special_tags[jammy]="${image_name}:ubuntu-current-lts"
54+
special_tags[vanilla-kinetic]="${image_name}:vanilla-ubuntu-current"
55+
special_tags[vanilla-jammy]="${image_name}:vanilla-ubuntu-current-lts"
6256
63-
base_image=${base_image_from_matrix[${{ matrix.base }}]}
57+
declare -A mpd_version_dict
58+
mpd_version_dict[kinetic]=0.23.12
59+
mpd_version_dict[jammy]=0.23.12
60+
mpd_version_dict[vanilla-kinetic]=0.23.9
61+
mpd_version_dict[vanilla-jammy]=0.23.5
6462
65-
# mpd version is 0.23.12 (compiled)
66-
mpd_version=0.23.12
63+
# select mpd version
64+
mpd_version=${mpd_version_dict["${distro_id}"]};
6765
6866
tags=""
6967
if [ "${ref_type}" = "branch" ]; then
@@ -116,9 +114,8 @@ jobs:
116114
fi
117115
echo "Building tags: ["${tags}"]"
118116
echo "RELEASE_TAGS=${tags}" >> $GITHUB_ENV
119-
echo "BASE_IMAGE=${select_compiler_image}" >> $GITHUB_ENV
117+
echo "BASE_IMAGE=${select_base_image}" >> $GITHUB_ENV
120118
echo "INTEGER_UPSAMPLING_SUPPORT=yes" >> $GITHUB_ENV
121-
echo "LIBFMT_PACKAGE_NAME=${select_libfmt_package_name}" >> $GITHUB_ENV
122119
123120
- name: Set up QEMU
124121
uses: docker/setup-qemu-action@v2
@@ -142,7 +139,6 @@ jobs:
142139
build-args: |
143140
BASE_IMAGE=${{ env.BASE_IMAGE }}
144141
INTEGER_UPSAMPLING_SUPPORT=${{ env.INTEGER_UPSAMPLING_SUPPORT }}
145-
LIBFMT_PACKAGE_NAME=${{ env.LIBFMT_PACKAGE_NAME }}
146142
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
147143
push: true
148144
tags: ${{ env.RELEASE_TAGS }}

Dockerfile

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ FROM ${BASE_IMAGE} AS BASE
33

44
ARG INTEGER_UPSAMPLING_SUPPORT="${INTEGER_UPSAMPLING_SUPPORT:-no}"
55
ARG USE_APT_PROXY
6-
ARG LIBFMT_PACKAGE_NAME
76

87
RUN mkdir -p /app/conf
98

109
RUN echo "USE_APT_PROXY=["${USE_APT_PROXY}"]"
1110
RUN echo "INTEGER_UPSAMPLING_SUPPORT=["${INTEGER_UPSAMPLING_SUPPORT}"]"
12-
RUN echo "LIBFMT_PACKAGE_NAME=["${LIBFMT_PACKAGE_NAME}"]"
1311

1412
COPY app/conf/01-apt-proxy /app/conf/
1513

@@ -25,21 +23,16 @@ ARG DEBIAN_FRONTEND=noninteractive
2523
RUN apt-get update
2624
#RUN apt-get upgrade -y
2725

28-
# upstream mpd is installed anyway
26+
# install mpd from repo
2927
RUN apt-get install -y mpd
3028

31-
# required libraries: we are installing these for support of
32-
# the build scenario when base image is not giof71/mpd-compiler
29+
# install required libraries
3330
RUN apt-get install -y --no-install-recommends alsa-utils
3431
RUN apt-get install -y --no-install-recommends pulseaudio-utils
3532
RUN apt-get install -y --no-install-recommends libasound2-plugin-equal
36-
RUN apt-get install -y --no-install-recommends mpdscribble
3733

38-
RUN if [ -n "$LIBFMT_PACKAGE_NAME" ]; then apt-get install -y --no-install-recommends $LIBFMT_PACKAGE_NAME; fi
39-
RUN apt-get install -y --no-install-recommends libsidplay2
40-
RUN apt-get install -y --no-install-recommends libsidutils0
41-
RUN apt-get install -y --no-install-recommends libresid-builder-dev
42-
RUN apt-get install -y --no-install-recommends libaudiofile-dev
34+
# install scrobbler (mpdscribbler)
35+
RUN apt-get install -y --no-install-recommends mpdscribble
4336

4437
RUN rm -rf /var/lib/apt/lists/*
4538

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,16 @@ Two binaries are available in the container image:
3838
The current mpd version is `v0.23.12`. I am building using [debian:bullseye-slim](https://hub.docker.com/_/debian/tags?page=1&name=bullseye-slim) (tags: `stable`, `bullseye`), [ubuntu:jammy](https://hub.docker.com/_/ubuntu/tags?page=1&name=jammy) (tags: `ubuntu-current-lts`, `jammy`) and [ubuntu:kinetic](https://hub.docker.com/_/ubuntu/tags?page=1&name=kinetic) (`latest`, `ubuntu-current`, `kinetic`) as base images.
3939
The `mpdscribble` version depends on the base image. See the following table:
4040

41-
Base Distro|Tags|MPD Version|MPDScribble Version
42-
:---|:---|:---|:---
43-
debian bullseye|**latest**, **stable**, bullseye|0.23.12|0.22-6
44-
debian bookworm|**edge**, bookworm|0.23.12|0.24-2
45-
ubuntu jammy|jammy, ubuntu-current-lts|0.23.12|0.23-1
46-
ubuntu kinetic|kinetic, ubuntu-current|0.23.12|0.24-2
41+
Base Distro|Tags|Compiled MPD version|Repo MPD version|MPDScribble version
42+
:---|:---|:---|:---|:---
43+
giof71/mpd-compiler:bookworm|**edge**, bookworm|0.23.12|0.23.12|0.24
44+
giof71/mpd-compiler:bullseye|**latest**, **stable**, bullseye|0.23.12|0.22.6|0.22
45+
giof71/mpd-compiler:kinetic|kinetic, ubuntu-current|0.23.12|0.23.9|0.24
46+
giof71/mpd-compiler:jammy|jammy, ubuntu-current-lts|0.23.12|0.23.5|0.23
47+
debian:bookworm-slim|**vanilla-edge**, vanilla-bookworm|-|0.23.12|0.24
48+
debian:bullseye-slim|**vanilla-latest**, **vanilla-stable**, **vanilla**, vanilla-bullseye|-|0.22.6|0.22
49+
ubuntu:kinetic|vanilla-kinetic, vanilla-ubuntu-current|-|0.23.9|0.24
50+
ubuntu:jammy|vanilla-jammy, vanilla-ubuntu-current-lts|-|0.23.5|0.23
4751

4852
## Why
4953

build.sh

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,36 @@ base_image_tags[bullseye]=giof71/mpd-compiler:bullseye
1414
base_image_tags[bookworm]=giof71/mpd-compiler:bookworm
1515
base_image_tags[jammy]=giof71/mpd-compiler:jammy
1616
base_image_tags[kinetic]=giof71/mpd-compiler:kinetic
17+
base_image_tags[vanilla-bookworm]=debian:bookworm-slim
18+
base_image_tags[vanilla-buster]=debian:buster-slim
19+
base_image_tags[vanilla-bullseye]=debian:bullseye-slim
20+
base_image_tags[vanilla-jammy]=ubuntu:jammy
21+
base_image_tags[vanilla-kinetic]=ubuntu:kinetic
22+
base_image_tags[vanilla-focal]=ubuntu:focal
23+
base_image_tags[vanilla-bionic]=ubuntu:bionic
24+
25+
declare -A local_tag
26+
local_tag[bookworm]=local-bookworm
27+
local_tag[buster]=local-buster
28+
local_tag[bullseye]=local-bullseye
29+
local_tag[jammy]=local-jammy
30+
local_tag[kinetic]=local-kinetic
31+
local_tag[focal]=local-focal
32+
local_tag[bionic]=local-bionic
33+
local_tag[local-bookworm]=local-bookworm
34+
local_tag[local-buster]=local-buster
35+
local_tag[local-bullseye]=local-bullseye
36+
local_tag[local-jammy]=local-jammy
37+
local_tag[local-kinetic]=local-kinetic
38+
local_tag[local-focal]=local-focal
39+
local_tag[local-bionic]=local-bionic
40+
local_tag[vanilla-bookworm]=local-vanilla-bookworm
41+
local_tag[vanilla-buster]=local-vanilla-buster
42+
local_tag[vanilla-bullseye]=local-vanilla-bullseye
43+
local_tag[vanilla-jammy]=local-vanilla-jammy
44+
local_tag[vanilla-kinetic]=local-vanilla-kinetic
45+
local_tag[vanilla-focal]=local-vanilla-focal
46+
local_tag[vanilla-bionic]=local-vanilla-bionic
1747

1848
declare -A integer_upsampling_support_dict
1949
integer_upsampling_support_dict[local-bookworm]=yes
@@ -25,17 +55,11 @@ integer_upsampling_support_dict[bullseye]=yes
2555
integer_upsampling_support_dict[jammy]=yes
2656
integer_upsampling_support_dict[kinetic]=yes
2757

28-
declare -A libfmt_dict
29-
libfmt_dict[local-bullseye]=libfmt7
30-
libfmt_dict[bullseye]=libfmt7
31-
libfmt_dict[local-bookworm]=libfmt9
32-
libfmt_dict[bookworm]=libfmt9
33-
3458
DEFAULT_BASE_IMAGE=bullseye
35-
DEFAULT_TAG=local-bullseye
59+
DEFAULT_TAG=local
3660
DEFAULT_USE_PROXY=N
3761

38-
tag=$DEFAULT_TAG
62+
tag=""
3963
git_branch="$DEFAULT_GIT_VERSION"
4064

4165
while getopts b:t:p: flag
@@ -61,19 +85,19 @@ if [ -z "${selected_image_tag}" ]; then
6185
exit 2
6286
fi
6387

64-
integer_upsampling_support=${integer_upsampling_support_dict[$base_image_tag]}
65-
if [ -z "${integer_upsampling_support}" ]; then
66-
echo "Integer upsampling support table entry missing for ["${base_image_tag}"]"
67-
exit 2
88+
select_tag=${local_tag[$base_image_tag]}
89+
if [[ -n "$select_tag" ]]; then
90+
tag=$select_tag
91+
else
92+
tag=$DEFAULT_TAG
6893
fi
6994

70-
libfmt_package_name=${libfmt_dict[$base_image_tag]}
71-
if [ -z "${libfmt_package_name}" ]; then
72-
echo "LibFmt package table entry missing for ["${base_image_tag}"], probably not needed"
73-
#exit 2
95+
integer_upsampling_support=${integer_upsampling_support_dict[$base_image_tag]}
96+
if [ -z "${integer_upsampling_support}" ]; then
97+
echo "Integer upsampling support table entry missing for ["${base_image_tag}"], assuming \"no\""
98+
integer_upsampling_support="no"
7499
fi
75100

76-
77101
if [ -z "${proxy}" ]; then
78102
proxy="N"
79103
fi
@@ -92,13 +116,11 @@ fi
92116

93117
echo "Base Image Tag: [$selected_image_tag]"
94118
echo "Integer Upsampling support: [$integer_upsampling_support]"
95-
echo "Package name libfmt: [$libfmt_package_name]"
96119
echo "Build Tag: [$tag]"
97120
echo "Proxy: [$proxy]"
98121

99122
docker build . \
100123
--build-arg BASE_IMAGE=${selected_image_tag} \
101124
--build-arg USE_APT_PROXY=${proxy} \
102125
--build-arg INTEGER_UPSAMPLING_SUPPORT=${integer_upsampling_support} \
103-
--build-arg LIBFMT_PACKAGE_NAME=${libfmt_package_name} \
104126
-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-27|Add `vanilla` images (see issue[#272](https://github.com/GioF71/mpd-alsa-docker/issues/272))
56
2023-03-25|Add support for selection of repo binary (`FORCE_REPO_BINARY`)
67
2023-03-24|Add armv6 support on debian-based images (see issue [#258](https://github.com/GioF71/mpd-alsa-docker/issues/258))
78
2023-03-20|Missing libaudiofile-dev (see issue [#253](https://github.com/GioF71/mpd-alsa-docker/issues/253) issue)

0 commit comments

Comments
 (0)