Skip to content

Commit

Permalink
Merge pull request #3 from GioF71/2-maintenance-switch-to-bookworm
Browse files Browse the repository at this point in the history
[Maintenance] Switch to bookworm #2
  • Loading branch information
GioF71 authored Jul 24, 2023
2 parents 1d6be56 + 829215e commit 5e5c746
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 28 deletions.
48 changes: 29 additions & 19 deletions .github/workflows/docker-multi-arch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ jobs:
strategy:
fail-fast: false
matrix:
base: ["bullseye"]
base: ["bookworm"]

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Prepare for docker build
id: prepare
run: |
ref_type=${{ github.ref_type }}
echo "REF_TYPE: ["$ref_type"]"
Expand All @@ -35,30 +36,39 @@ jobs:
image_name=${{secrets.DOCKER_USERNAME}}/minidlna
declare -A base_image_from_matrix
base_image_from_matrix[sid]=debian:sid-slim
base_image_from_matrix[trixie]=debian:trixie-slim
base_image_from_matrix[bookworm]=debian:bookworm-slim
base_image_from_matrix[bullseye]=debian:bullseye-slim
declare -A mpd_versions
mpd_versions[bullseye]=1.3.0
declare -A app_version_table
app_version_table[sid]=1.3.2
app_version_table[trixie]=1.3.2
app_version_table[bookworm]=1.3.0
app_version_table[bullseye]=1.3.0
declare -A special_tags
special_tags[bullseye]="${image_name}:stable,${image_name}:latest"
special_tags[sid]="${image_name}:unstable"
special_tags[trixie]="${image_name}:nextstable"
special_tags[bookworm]="${image_name}:stable,${image_name}:latest"
special_tags[bullseye]="${image_name}:oldstable"
base_image=${base_image_from_matrix[${{ matrix.base }}]}
mpd_version=${mpd_versions[${{ matrix.base }}]}
app_version=${app_version_table[${{ matrix.base }}]}
tags=""
if [ "${ref_type}" = "branch" ]; then
echo "branch mode";
if [ "${ref_name}" = "main" ]; then
echo "main branch";
tags="${image_name}:main-${distro_id}";
tags="$tags,${image_name}:main-${distro_id}-${mpd_version}";
tags="$tags,${image_name}:main-${distro_id}-${app_version}";
elif [ "${ref_name}" = "devel" ]; then
echo "devel branch";
tags="${image_name}:devel-${distro_id}-${mpd_version}"
tags="${image_name}:devel-${distro_id}-${app_version}"
else
echo "other branch ["${ref_name}"]";
tags="${image_name}:branch-${ref_name}-${distro_id}-${mpd_version}";
tags="${image_name}:branch-${ref_name}-${distro_id}-${app_version}";
fi
elif [ "${ref_type}" = "tag" ]; then
echo "tag mode";
Expand All @@ -71,8 +81,8 @@ jobs:
echo "release tag";
echo "Building now: ["$distro_id"]";
tags="${tags},$image_name:${distro_id}";
tags="${tags},$image_name:${distro_id}-${mpd_version}"
tags="$tags,$image_name:${distro_id}-${mpd_version}-${tag_name}"
tags="${tags},$image_name:${distro_id}-${app_version}"
tags="$tags,$image_name:${distro_id}-${app_version}-${tag_name}"
select_special_tags=${special_tags["${distro_id}"]};
if [[ -n "${select_special_tags}" ]]; then
echo "Found special tags for ["${distro_id}"]=["${select_special_tags}"]";
Expand All @@ -82,22 +92,22 @@ jobs:
fi
elif [ "${tag_type}" = "main" ]; then
echo "main tag";
tags="${image_name}:main-${tag_name}-${distro_id}-${mpd_version}";
tags="${image_name}:main-${tag_name}-${distro_id}-${app_version}";
elif [ "${tag_type}" = "devel" ]; then
echo "devel tag";
tags="${image_name}:devel-${tag_name}-${distro_id}-${mpd_version}";
tags="${image_name}:devel-${tag_name}-${distro_id}-${app_version}";
elif [ "${tag_type}" = "feature" ]; then
echo "feature tag";
tags="${image_name}:feature-${tag_name}-${distro_id}-${mpd_version}";
tags="${image_name}:feature-${tag_name}-${distro_id}-${app_version}";
elif [ "${tag_type}" = "daily" ]; then
echo "daily build";
tags="${tags},${image_name}:daily-${distro_id}";
tags="${tags},${image_name}:daily-${distro_id}-${mpd_version}";
tags="${tags},${image_name}:daily-${distro_id}-${app_version}";
fi
fi
echo "Building tags: ["${tags}"]"
echo "RELEASE_TAGS=${tags}" >> $GITHUB_ENV
echo "BASE_IMAGE=${base_image}" >> $GITHUB_ENV
echo "RELEASE_TAGS=${tags}" >> $GITHUB_OUTPUT
echo "BASE_IMAGE=${base_image}" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
Expand All @@ -119,7 +129,7 @@ jobs:
with:
context: .
build-args: |
BASE_IMAGE=${{ env.BASE_IMAGE }}
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
BASE_IMAGE=${{ steps.prepare.outputs.BASE_IMAGE }}
platforms: linux/amd64,linux/arm/v5,linux/arm/v7,linux/arm64/v8
push: true
tags: ${{ env.RELEASE_TAGS }}
tags: ${{ steps.prepare.outputs.RELEASE_TAGS }}
19 changes: 13 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG IMAGE_TAG="${IMAGE_TAG:-bullseye}"
FROM debian:${IMAGE_TAG} AS base
ARG BASE_IMAGE
FROM ${BASE_IMAGE:-debian:stable-slim} AS BASE
ARG USE_APT_PROXY

RUN mkdir -p /app
Expand All @@ -9,16 +9,23 @@ RUN mkdir -p /app/doc
COPY app/conf/01-apt-proxy /app/conf/

RUN if [ "${USE_APT_PROXY}" = "Y" ]; then \
echo "Builind using apt proxy"; \
cp /app/conf/01-apt-proxy /etc/apt/apt.conf.d/01-apt-proxy; \
cat /etc/apt/apt.conf.d/01-apt-proxy; \
echo "Builind using apt proxy"; \
cp /app/conf/01-apt-proxy /etc/apt/apt.conf.d/01-apt-proxy; \
cat /etc/apt/apt.conf.d/01-apt-proxy; \
else \
echo "Building without apt proxy"; \
echo "Building without apt proxy"; \
fi

RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
RUN apt-get install minidlna -y

RUN if [ "${USE_APT_PROXY}" = "Y" ]; then \
echo "Removing apt proxy configuration ..."; \
rm /etc/apt/apt.conf.d/01-apt-proxy; \
echo ". Done."; \
fi

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

COPY README.md /app/doc
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ A Docker image for `minidlna`.
## Available Archs on Docker Hub

- linux/amd64
- linux/arm/v7
- linux/arm64/v8
- linux/arm/v7
- linux/arm/v5

## Reference

Expand Down Expand Up @@ -77,7 +78,7 @@ MINIDLNA_DIR_P_2||Picture Path #2
MINIDLNA_DIR_P_3||Picture Path #3
MINIDLNA_DIR_P_4||Picture Path #4
MINIDLNA_DIR_P_5||Picture Path #5
MINIDLNA_MERGE_MEDIA_DIRS||Set this to merge all media_dir base contents into the root container.The default is no.
MINIDLNA_MERGE_MEDIA_DIRS||Set this to merge all media_dir base contents into the root container. The default is `no`.

### Volumes

Expand Down Expand Up @@ -131,4 +132,5 @@ Just be careful to use the tag you have built.

Date|Major Changes
:---|:---
2023-07-24|Switch to bookworm, see [#2](https://github.com/GioF71/minidlna-docker/issues/2)
2022-10-23|Initial release
5 changes: 4 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@
declare -A base_images

base_images[sid]=debian:sid-slim
base_images[unstable]=debian:unstable-slim
base_images[stable]=debian:stable-slim
base_images[trixie]=debian:trixie-slim
base_images[bookworm]=debian:bookworm-slim
base_images[bullseye]=debian:bullseye-slim
base_images[buster]=debian:buster-slim
base_images[jammy]=ubuntu:jammy

DEFAULT_BASE_IMAGE=bullseye
DEFAULT_BASE_IMAGE=bookworm
DEFAULT_TAG=local
DEFAULT_USE_PROXY=N

Expand Down

0 comments on commit 5e5c746

Please # to comment.