Fix Docker build

This commit is contained in:
Shadowghost
2025-09-27 13:06:11 +02:00
parent 69275351c9
commit b725dd43eb
4 changed files with 29 additions and 151 deletions

View File

@@ -1,127 +0,0 @@
name: "Release Build Trixie"
on:
workflow_dispatch:
# Manual trigger (from bot)
inputs:
version:
required: true
type: string
description: 'The server and web stable release tag (i.e. "vX.Y.Z")'
env:
SDK_VERSION: "9.0.x"
permissions:
contents: read
jobs:
Debian:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
release:
- trixie
arch:
#- amd64
- arm64
continue-on-error: false # true in prod, false for testing
steps:
- name: "Set dated version for unstable builds"
id: version
run: |-
echo "JELLYFIN_VERSION=${{ inputs.version }}" >> $GITHUB_ENV
echo "JELLYFIN_RELEASE_TYPE=stable" >> $GITHUB_ENV
- name: "Install dependencies"
run: |-
sudo apt-get update
sudo apt-get install --yes python3-git python3-yaml debsigs devscripts
- name: "Checkout repository"
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: "Prepare repository"
run: |-
./checkout.py ${{ inputs.version || 'master' }}
- name: "Run builder for ${{ matrix.version }} ${{ matrix.arch }}"
run: |-
sudo --preserve-env ./build.py ${{ env.JELLYFIN_VERSION }} debian ${{ matrix.arch }} ${{ matrix.release }} ${{ env.DEBUG_FLAG }}
sudo chown --recursive $USER out/debian
- name: "Import repository signing GPG key"
run: |
echo -n "${{ secrets.DEBIAN_SIGNING_KEY }}" | base64 --decode | gpg --batch --yes --import
- name: "Sign Debian package and source files"
run: |
for file in out/debian/*.deb; do
debsigs --sign=origin --default-key=${{ secrets.DEBIAN_SIGNING_KEY_ID }} ${file}
done
debsign -k ${{ secrets.DEBIAN_SIGNING_KEY_ID }} out/debian/*.changes
- name: "Remove repository signing GPG key"
run: |
gpg --batch --yes --delete-secret-keys ${{ secrets.DEBIAN_SIGNING_KEY_ID }}
- name: "Upload artifacts to repository server"
uses: appleboy/scp-action@ff85246acaad7bdce478db94a363cd2bf7c90345 # v1.0.0
with:
host: "${{ secrets.REPO_HOST }}"
username: "${{ secrets.REPO_USER }}"
key: "${{ secrets.REPO_KEY }}"
source: "out/debian/*"
strip_components: 2
target: "/srv/incoming/server/${{ env.JELLYFIN_VERSION }}/debian/${{ matrix.release }}/${{ matrix.arch }}"
- name: "Import artifacts into reprepro"
uses: appleboy/ssh-action@2ead5e36573f08b82fbfce1504f1a4b05a647c6f # v1.2.2
with:
host: "${{ secrets.REPO_HOST }}"
username: "${{ secrets.REPO_USER }}"
key: "${{ secrets.REPO_KEY }}"
debug: false
script: |
set -o xtrace
COMPONENT="main"
# Only include the architecture-dependent deb here, as the others are done only for amd64
sudo reprepro --waitforlock 30 --basedir /srv/debian --component ${COMPONENT} includedeb ${{ matrix.release }} /srv/incoming/server/${{ env.JELLYFIN_VERSION }}/debian/${{ matrix.release }}/${{ matrix.arch }}/*_${{ matrix.arch }}.deb || exit 1
if [[ ${{ matrix.arch }} == "amd64" ]]; then
# Only include the architecture-independent packages for amd64; the other architectures are the same and conflict
sudo reprepro --waitforlock 30 --basedir /srv/debian --component ${COMPONENT} includedeb ${{ matrix.release }} /srv/incoming/server/${{ env.JELLYFIN_VERSION }}/debian/${{ matrix.release }}/${{ matrix.arch }}/*_all.deb || exit 1
# Only include the source DSC for amd64; the other architectures are the same and conflict
sudo reprepro --waitforlock 30 --basedir /srv/debian --component ${COMPONENT} includedsc ${{ matrix.release }} /srv/incoming/server/${{ env.JELLYFIN_VERSION }}/debian/${{ matrix.release }}/${{ matrix.arch }}/*.dsc || exit 1
fi
# Only keep the latest point release for a given stable version; i.e. 10.10.14 obsoletes 10.10.13 and removes it, while leaving 10.9.10
NEW_VERSION=${{ matrix.release }}
NEW_MAJOR_VERSION="${NEW_VERSION#v}"
NEW_MAJOR_VERSION="${NEW_MAJOR_VERSION%.*}"
NEW_POINT_VERSION="${NEW_VERSION##*.}"
if [[ ${NEW_POINT_VERSION} -gt 0 ]]; then
LAST_POINT_VERSION=$(( NEW_POINT_VERSION - 1 ))
LAST_VERSION="${NEW_MAJOR_VERSION}.${LAST_POINT_VERSION}"
for PACKAGE in jellyfin jellyfin-server jellyfin-web; do
for SCRAP_VERSION in $( sudo reprepro --waitforlock 30 --basedir /srv/debian --component ${COMPONENT} list ${{ matrix.release }} | grep "${PACKAGE} " | grep "${LAST_VERSION}" | sort | uniq ); do
sudo reprepro --waitforlock 30 --basedir /srv/debian --component ${COMPONENT} remove ${{ matrix.release }} ${PACKAGE}=${SCRAP_VERSION}
done
done
fi
- name: "Move artifacts into repository"
uses: appleboy/ssh-action@2ead5e36573f08b82fbfce1504f1a4b05a647c6f # v1.2.2
with:
host: "${{ secrets.REPO_HOST }}"
username: "${{ secrets.REPO_USER }}"
key: "${{ secrets.REPO_KEY }}"
debug: false
script: |
export BASEDIR="/srv/repository/main/server/debian"
sudo mkdir -p ${BASEDIR}/${{ env.JELLYFIN_RELEASE_TYPE }}/${{ env.JELLYFIN_VERSION }}/${{ matrix.arch }} || exit 1
sudo mv -t ${BASEDIR}/${{ env.JELLYFIN_RELEASE_TYPE }}/${{ env.JELLYFIN_VERSION }}/${{ matrix.arch }}/ /srv/incoming/server/${{ env.JELLYFIN_VERSION }}/debian/${{ matrix.release }}/${{ matrix.arch }}/* || exit 1
sudo rm ${BASEDIR}/latest-${{ env.JELLYFIN_RELEASE_TYPE }} || true
sudo ln -sf ${BASEDIR}/${{ env.JELLYFIN_RELEASE_TYPE }}/${{ env.JELLYFIN_VERSION }} ${BASEDIR}/latest-${{ env.JELLYFIN_RELEASE_TYPE }} || exit 1
sudo rm ${BASEDIR}/latest || true
sudo ln -sf ${BASEDIR}/${{ env.JELLYFIN_RELEASE_TYPE }}/${{ env.JELLYFIN_VERSION }} ${BASEDIR}/latest || exit 1

View File

@@ -58,7 +58,6 @@ def _determine_framework_versions():
framework_args = dict() framework_args = dict()
submodules = dict()
for submodule in this_repo.submodules: for submodule in this_repo.submodules:
if submodule.name in configurations["frameworks"].keys(): if submodule.name in configurations["frameworks"].keys():
for framework_arg in configurations["frameworks"][submodule.name].keys(): for framework_arg in configurations["frameworks"][submodule.name].keys():
@@ -412,7 +411,7 @@ def build_docker(
if build_arch: if build_arch:
if build_arch not in architectures: if build_arch not in architectures:
log(f"Error: Archtecture {build_arch} is not valid.") log(f"Error: Architecture {build_arch} is not valid.")
exit(1) exit(1)
else: else:
architectures = [build_arch] architectures = [build_arch]
@@ -448,7 +447,6 @@ def build_docker(
# Get our ARCH variables from the archmaps # Get our ARCH variables from the archmaps
PACKAGE_ARCH = configurations["docker"]["archmaps"][_build_arch]["PACKAGE_ARCH"] PACKAGE_ARCH = configurations["docker"]["archmaps"][_build_arch]["PACKAGE_ARCH"]
DOTNET_ARCH = configurations["docker"]["archmaps"][_build_arch]["DOTNET_ARCH"] DOTNET_ARCH = configurations["docker"]["archmaps"][_build_arch]["DOTNET_ARCH"]
QEMU_ARCH = configurations["docker"]["archmaps"][_build_arch]["QEMU_ARCH"]
IMAGE_ARCH = configurations["docker"]["archmaps"][_build_arch]["IMAGE_ARCH"] IMAGE_ARCH = configurations["docker"]["archmaps"][_build_arch]["IMAGE_ARCH"]
TARGET_ARCH = configurations["docker"]["archmaps"][_build_arch]["TARGET_ARCH"] TARGET_ARCH = configurations["docker"]["archmaps"][_build_arch]["TARGET_ARCH"]
@@ -460,10 +458,10 @@ def build_docker(
# Clean up any existing qemu static image # Clean up any existing qemu static image
log( log(
f">>> {docker_run_cmd} --privileged multiarch/qemu-user-static:register --reset" f">>> {docker_run_cmd} --privileged linuxserver/qemu-static --reset -p yes"
) )
os.system( os.system(
f"{docker_run_cmd} --privileged multiarch/qemu-user-static:register --reset" f"{docker_run_cmd} --privileged linuxserver/qemu-static --reset -p yes"
) )
log("") log("")
@@ -471,7 +469,6 @@ def build_docker(
build_args = list() build_args = list()
build_args.append(f"--build-arg PACKAGE_ARCH={PACKAGE_ARCH}") build_args.append(f"--build-arg PACKAGE_ARCH={PACKAGE_ARCH}")
build_args.append(f"--build-arg DOTNET_ARCH={DOTNET_ARCH}") build_args.append(f"--build-arg DOTNET_ARCH={DOTNET_ARCH}")
build_args.append(f"--build-arg QEMU_ARCH={QEMU_ARCH}")
build_args.append(f"--build-arg IMAGE_ARCH={IMAGE_ARCH}") build_args.append(f"--build-arg IMAGE_ARCH={IMAGE_ARCH}")
build_args.append(f"--build-arg TARGET_ARCH={TARGET_ARCH}") build_args.append(f"--build-arg TARGET_ARCH={TARGET_ARCH}")
build_args.append(f"--build-arg JELLYFIN_VERSION={jellyfin_version}") build_args.append(f"--build-arg JELLYFIN_VERSION={jellyfin_version}")
@@ -485,6 +482,9 @@ def build_docker(
f"--build-arg {arg}={framework_versions[arg]}" f"--build-arg {arg}={framework_versions[arg]}"
) )
if local:
build_args.append("--load")
build_args = ' '.join(build_args) build_args = ' '.join(build_args)
# Build the dockerfile # Build the dockerfile

View File

@@ -118,13 +118,11 @@ docker:
DOTNET_ARCH: x64 DOTNET_ARCH: x64
IMAGE_ARCH: amd64 IMAGE_ARCH: amd64
PACKAGE_ARCH: amd64 PACKAGE_ARCH: amd64
QEMU_ARCH: x86_64
TARGET_ARCH: amd64 TARGET_ARCH: amd64
arm64: arm64:
DOTNET_ARCH: arm64 DOTNET_ARCH: arm64
IMAGE_ARCH: arm64v8 IMAGE_ARCH: arm64v8
PACKAGE_ARCH: arm64 PACKAGE_ARCH: arm64
QEMU_ARCH: aarch64
TARGET_ARCH: arm64/v8 TARGET_ARCH: arm64/v8
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile
imagename: jellyfin/jellyfin imagename: jellyfin/jellyfin

View File

@@ -3,7 +3,7 @@ ARG DOTNET_VERSION=8.0
ARG NODEJS_VERSION=20 ARG NODEJS_VERSION=20
# Combined image version (Debian) # Combined image version (Debian)
ARG OS_VERSION=bookworm ARG OS_VERSION=trixie
# Jellyfin FFMPEG package # Jellyfin FFMPEG package
ARG FFMPEG_PACKAGE=jellyfin-ffmpeg7 ARG FFMPEG_PACKAGE=jellyfin-ffmpeg7
@@ -27,8 +27,6 @@ ARG MALI_PKG_CFG=valhall-g610-g24p0-gbm
ARG PACKAGE_ARCH ARG PACKAGE_ARCH
# Dotnet architeture (x64, arm64, arm), set by build script # Dotnet architeture (x64, arm64, arm), set by build script
ARG DOTNET_ARCH ARG DOTNET_ARCH
# QEMU architecture (x86_64, aarch64, arm), set by build script
ARG QEMU_ARCH
# Base Image architecture (amd64, arm64v8, arm32v7), set by build script # Base Image architecture (amd64, arm64v8, arm32v7), set by build script
ARG IMAGE_ARCH ARG IMAGE_ARCH
# Target platform architecture (amd64, arm64/v8, arm/v7), set by build script # Target platform architecture (amd64, arm64/v8, arm/v7), set by build script
@@ -74,9 +72,10 @@ RUN npm ci --no-audit --unsafe-perm \
# #
# Build the server artifacts # Build the server artifacts
# #
FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION}-${OS_VERSION}-slim AS server FROM --platform=linux/${TARGET_ARCH} ${IMAGE_ARCH}/debian:${OS_VERSION}-slim AS server
ARG DOTNET_ARCH ARG DOTNET_ARCH
ARG DOTNET_VERSION
ARG SOURCE_DIR=/src ARG SOURCE_DIR=/src
ARG ARTIFACT_DIR=/server ARG ARTIFACT_DIR=/server
@@ -88,6 +87,13 @@ WORKDIR ${SOURCE_DIR}
COPY jellyfin-server . COPY jellyfin-server .
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
RUN apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests --yes \
curl \
ca-certificates \
libicu76 \
&& curl -fsSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel ${DOTNET_VERSION} --install-dir /usr/local/bin
RUN dotnet publish Jellyfin.Server --arch ${DOTNET_ARCH} --configuration ${CONFIG} \ RUN dotnet publish Jellyfin.Server --arch ${DOTNET_ARCH} --configuration ${CONFIG} \
--output="${ARTIFACT_DIR}" --self-contained \ --output="${ARTIFACT_DIR}" --self-contained \
-p:DebugSymbols=false -p:DebugType=none -p:DebugSymbols=false -p:DebugType=none
@@ -95,7 +101,6 @@ RUN dotnet publish Jellyfin.Server --arch ${DOTNET_ARCH} --configuration ${CONFI
# #
# Build the final combined image # Build the final combined image
# #
FROM multiarch/qemu-user-static:x86_64-${QEMU_ARCH} AS qemu
FROM --platform=linux/${TARGET_ARCH} ${IMAGE_ARCH}/debian:${OS_VERSION}-slim AS combined FROM --platform=linux/${TARGET_ARCH} ${IMAGE_ARCH}/debian:${OS_VERSION}-slim AS combined
ARG OS_VERSION ARG OS_VERSION
@@ -113,11 +118,6 @@ ARG MALI_PKG_TAG
ARG MALI_PKG_CFG ARG MALI_PKG_CFG
ARG PACKAGE_ARCH ARG PACKAGE_ARCH
ARG DOTNET_ARCH
ARG QEMU_ARCH
# Copy the QEMU runtime
COPY --from=qemu /usr/bin/* /usr/bin
# Set the health URL # Set the health URL
ENV HEALTHCHECK_URL=http://localhost:8096/health ENV HEALTHCHECK_URL=http://localhost:8096/health
@@ -150,15 +150,23 @@ RUN apt-get update \
ca-certificates \ ca-certificates \
gnupg \ gnupg \
curl \ curl \
apt-transport-https \
&& curl -fsSL https://repo.jellyfin.org/jellyfin_team.gpg.key \ && curl -fsSL https://repo.jellyfin.org/jellyfin_team.gpg.key \
| gpg --dearmor -o /etc/apt/trusted.gpg.d/debian-jellyfin.gpg \ | gpg --dearmor -o /etc/apt/keyrings/jellyfin.gpg \
&& echo "deb [arch=${PACKAGE_ARCH}] https://repo.jellyfin.org/master/debian ${OS_VERSION} main" > /etc/apt/sources.list.d/jellyfin.list \ && cat <<EOF > /etc/apt/sources.list.d/jellyfin.sources
&& apt-get update \ Types: deb
URIs: https://repo.jellyfin.org/debian
Suites: ${OS_VERSION}
Components: main
Architectures: ${PACKAGE_ARCH}
Signed-By: /etc/apt/keyrings/jellyfin.gpg
EOF
RUN apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests --yes \ && apt-get install --no-install-recommends --no-install-suggests --yes \
${FFMPEG_PACKAGE} \ ${FFMPEG_PACKAGE} \
openssl \ openssl \
locales \ locales \
libicu76 \
libfontconfig1 \ libfontconfig1 \
libfreetype6 \ libfreetype6 \
libjemalloc2 \ libjemalloc2 \
@@ -175,7 +183,7 @@ RUN if test "${PACKAGE_ARCH}" = "amd64"; then \
&& curl -LO https://github.com/intel/compute-runtime/releases/download/${NEO_VER}/libigdgmm12_${GMMLIB_VER}_amd64.deb \ && curl -LO https://github.com/intel/compute-runtime/releases/download/${NEO_VER}/libigdgmm12_${GMMLIB_VER}_amd64.deb \
-LO https://github.com/intel/intel-graphics-compiler/releases/download/v${IGC2_VER}/intel-igc-core-2_${IGC2_VER}+${IGC2_BUILD}_amd64.deb \ -LO https://github.com/intel/intel-graphics-compiler/releases/download/v${IGC2_VER}/intel-igc-core-2_${IGC2_VER}+${IGC2_BUILD}_amd64.deb \
-LO https://github.com/intel/intel-graphics-compiler/releases/download/v${IGC2_VER}/intel-igc-opencl-2_${IGC2_VER}+${IGC2_BUILD}_amd64.deb \ -LO https://github.com/intel/intel-graphics-compiler/releases/download/v${IGC2_VER}/intel-igc-opencl-2_${IGC2_VER}+${IGC2_BUILD}_amd64.deb \
-LO https://github.com/intel/compute-runtime/releases/download/${NEO_VER}/intel-opencl-icd_${NEO_VER}_amd64.deb \ -LO https://github.com/intel/compute-runtime/releases/download/${NEO_VER}/intel-opencl-icd_${NEO_VER}-0_amd64.deb \
-LO https://github.com/intel/intel-graphics-compiler/releases/download/igc-${IGC1_LEGACY_VER}/intel-igc-core_${IGC1_LEGACY_VER}_amd64.deb \ -LO https://github.com/intel/intel-graphics-compiler/releases/download/igc-${IGC1_LEGACY_VER}/intel-igc-core_${IGC1_LEGACY_VER}_amd64.deb \
-LO https://github.com/intel/intel-graphics-compiler/releases/download/igc-${IGC1_LEGACY_VER}/intel-igc-opencl_${IGC1_LEGACY_VER}_amd64.deb \ -LO https://github.com/intel/intel-graphics-compiler/releases/download/igc-${IGC1_LEGACY_VER}/intel-igc-opencl_${IGC1_LEGACY_VER}_amd64.deb \
-LO https://github.com/intel/compute-runtime/releases/download/${NEO_LEGACY_VER}/intel-opencl-icd-legacy1_${NEO_LEGACY_VER}_amd64.deb \ -LO https://github.com/intel/compute-runtime/releases/download/${NEO_LEGACY_VER}/intel-opencl-icd-legacy1_${NEO_LEGACY_VER}_amd64.deb \
@@ -226,7 +234,6 @@ RUN mkdir -p ${JELLYFIN_DATA_DIR} ${JELLYFIN_CACHE_DIR} \
COPY --from=server /server /jellyfin COPY --from=server /server /jellyfin
COPY --from=web /web /jellyfin/jellyfin-web COPY --from=web /web /jellyfin/jellyfin-web
ARG JELLYFIN_VERSION ARG JELLYFIN_VERSION
LABEL "org.opencontainers.image.source"="https://github.com/jellyfin/jellyfin-packaging" LABEL "org.opencontainers.image.source"="https://github.com/jellyfin/jellyfin-packaging"
LABEL "org.opencontainers.image.title"="Jellyfin" LABEL "org.opencontainers.image.title"="Jellyfin"