jellyfin / jellyfin-packaging

Jellyfin Packaging and Build Workflows
GNU General Public License v3.0
26 stars 24 forks source link

Jellyfin Packaging

Part of Jellyfin: The Free Software Media System


Logo Banner

GPL 3.0 License Current Release Translation Status Docker Pull Count
Donate Submit Feature Requests Chat on Matrix Join our Forum Release RSS Feed Master Commits RSS Feed


Jellyfin is the Free Software Media System that puts you in control of managing and streaming your media. It is an alternative to the proprietary Emby and Plex, to provide media from a dedicated server to end-user devices via multiple apps.

This repository contains operating system and Docker packaging for Jellyfin, for use by manual builders and our release CI system with GitHub workflows. All packaging has henceforth been removed from the main code repositories for the Jellyfin Server and Primary WebUI and moved here.

Quickstart

To build Jellyfin packages for yourself, follow this quickstart guide. You will need to be running on a Linux system, preferably Debian- or Ubuntu-based, with Docker, Python3 and the Python packages PyYAML and git (python3-yaml and python3-git in Debian). Other systems including WSL are untested.

  1. Install Docker on your system. The build scripts leverage Docker containers to perform clean builds and avoid contaminating the host system with dependencies.

  2. Clone this repository somewhere on your system and enter it.

  3. Run git submodule update --init to check out the submodules (jellyfin-server, jellyfin-web).

  4. Run ./checkout.py to update the submodules to the correct HEADs. This command takes one argument, the tag or branch (i.e. master) of the repositories to check out; if nothing is specified, master is assumed. For example, ./checkout.py master checks out the current master branch of both jellyfin-server and jellyfin-web, ./checkout.py v10.8.13 checks out the v10.8.13 tag of both, etc. If a tag is used and one (or more) of the repositories are missing the tag, this command will error out.

Non-Docker Platforms

If you want a non-Docker image output (.deb, tar/zip archive, etc.) follow this process:

  1. Run ./build.py. This command takes up to 4 arguments, depending on what you're trying to build:

    • The first argument is the version you want to tag your build as. For our official releases, we use either dates for unstable builds (YYYYMMDDHH numerical format or auto for autogeneration) or the tag without v for stable release builds (10.8.13, 10.9.0, etc.), but you can use any version tag you wish here.

    • The second argument is the "platform" you want to build for. The available options are listed as top-level keys in the build.yaml configuration file or in the -h help output.

    • The third argument is, for all platforms except portable (DotNET portable), the architecture you want to build for. For each platform, the available architectures can be found as the keys under archmaps in the build.yaml configuration file.

    • The fourth argument is exclusive to debian and ubuntu .deb packages, and is the release codename of Debian or Ubuntu to build for. For each platform, the available releases can be found as the keys under releases in the build.yaml configuration file.

    NOTE: Your running user must have Docker privileges, or you should run build.py as root/with sudo.

  2. The output binaries will be in the out/ directory, ready for use. The exact format varies depending on the build type, and can be found, for each archive-based platform, as the values to the archivetypes key in the build.yaml configuration file.

Examples

Build .deb packages for Debian 12 "Bookworm" amd64:

./build.py auto debian amd64 bookworm

Build Linux .tar.xx archives for arm64-musl:

./build.py auto linux arm64-musl

Build Windows .zip for amd64:

./build.py auto windows amd64

Build a .NET portable .zip:

./build.py auto portable

Docker Image Platform

If you want a Docker image output follow this process:

  1. Install docker and docker-buildx-plugin for your OS.

  2. Run ./build.py. This command takes up to 4 arguments specific to Docker builds:

    • The first argument is the version you want to tag your build as. For our official releases, we use either dates for unstable builds (YYYYMMDDHH numerical format or auto for autogeneration) or the tag without v for stable release builds (10.8.13, 10.9.0, etc.), but you can use any version tag you wish here.

    • The second argument is the "platform" you want to build for. For Docker images, this should be docker.

    • The third argument is the architecture you wish to build for. This argument is optional, and not providing it will build images for all supported architectures (sequentially).

    • The fourth argument is --local, which should be provided to prevent the script from trying to generate image manifests and push the resulting images to our repositories.

  3. The output container image(s) will be present in your docker image ls as jellyfin/jellyfin with the tag(s) <jellyfin_version>-<build_arch>.

Examples

Build an amd64 Docker image:

./build.py auto docker amd64 --local

Design

Inside this repository are 7 major components:

  1. Submodules for the jellyfin (as jellyfin-server) and jellyfin-web repositories. These are dynamic submodules; the checkout.py script will check them out to the required HEAD on each build, and thus their actual committed value is irrelevant. Nonetheless, they should be bumped occasionally just to avoid excessive checkout times later.

  2. Debian/Ubuntu packaging configurations (under debian). These will build the 3 Jellyfin packages (jellyfin metapackage, jellyfin-server core server, and jellyfin-web web client) from a single Dockerfile and helper script (build.sh) under debian/docker/. Future packages (e.g. Vue) may be added here as well if and when they are promoted to a production build alongside the others, following one consistent versioning scheme.

  3. Docker image builder (under docker). Like the above two as well, only building the combined Docker images with a single Dockerfile as well as preparing the various manifests needed to push these to the container repos.

  4. Portable image builder (under portable), which covers all the "archive" builds (.NET portable, Linux, Windows, and MacOS) again from a single Dockerfile.

  5. NuGet package builder, to prepare NuGet packages for consumption by plugins and 3rd party clients.

  6. Script infrastructure to handle coordinating builds (build.py). This script takes basic arguments and, using its internal logic, fires the correct Dockerized builds for the given build type.

  7. The GitHub Actions CI to build all the above for every supported version and architecture.

Design Decisions

General

Debian/Ubuntu Packages

Docker

Portable Builds (Portable .NET, Linux, MacOS, Windows)