Skip to content

Commit

Permalink
Switch to bookworm
Browse files Browse the repository at this point in the history
  • Loading branch information
GioF71 committed Jul 24, 2023
1 parent d8d52cc commit 4bcf425
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 32 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
14 changes: 8 additions & 6 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 @@ -49,15 +50,15 @@ Getting the image from DockerHub is as simple as typing:
### Environment Variables

Name|Default|Description
:---|:---|:---
:---|:---:|:---
MINIDLNA|8200|Web Interface Port
MINIDLNA_FRIENDLY_NAME||Defaults to `hostname: username`
MINIDLNA_SERIAL||Serial number the server reports to clients. Defaults to the MAC address of nework interface
MINIDLNA_MODEL_NAME||Model name the server reports to clients
MINIDLNA_MODEL_NUMBER||Model number the server reports to clients. Defaults to the version number of minidlna.
MINIDLNA_ENABLE_INOTIFY||Automatic discovery of new files in the media_dir directory
MINIDLNA_STRICT_DLNA||Strictly adhere to DLNA standards
MINIDLNA_ROOT_CONTAINER||
MINIDLNA_ROOT_CONTAINER||Possible values are `.` (Default), `B` (Browse), `M` (Music), `V` (Vidoes), `P` (Pictures)
MINIDLNA_FORCE_SORT_CRITERIA||Always set SortCriteria to this value, regardless of the SortCriteria passed by the client e.g. force_sort_criteria=+upnp:class,+upnp:originalTrackNumber,+dc:title
USER_MODE||Set to `Y` or `YES` to enable user mode
PUID||User id, defaults to `1000`
Expand All @@ -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 @@ -127,8 +128,9 @@ You can build (or rebuild) the image by opening a terminal from the root of the
It will take very little time even on a Raspberry Pi. When it's finished, you can run the container following the previous instructions.
Just be careful to use the tag you have built.

## Release History
## Change History

Release Date|Major Changes
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 4bcf425

Please sign in to comment.