Skip to content

Commit b1a9870

Browse files
committed
feat: add jellyfin, and replace malloc with jemalloc
1 parent 747079c commit b1a9870

File tree

5 files changed

+131
-0
lines changed

5 files changed

+131
-0
lines changed

apps/jellyfin/Dockerfile

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
FROM ghcr.io/ipromknight/ubuntu:rolling@sha256:7023b1419420f9cdb10f46c837fd80bf2b615f6aa273fdd82c45105b216fbdf1
2+
3+
ARG TARGETPLATFORM
4+
ARG BUILDPLATFORM
5+
ARG VERSION
6+
ARG CHANNEL
7+
8+
ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility"
9+
10+
# Disable glibc dynamic heap adjustment
11+
ENV MALLOC_TRIM_THRESHOLD_=131072
12+
13+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
14+
15+
# Replace malloc with jemalloc
16+
RUN apt-get -qq update \
17+
&& apt-get -qq install -y libjemalloc2 libjemalloc-dev
18+
19+
RUN curl -sL https://repositories.intel.com/graphics/intel-graphics.key | apt-key add - \
20+
&& echo 'deb [arch=amd64] https://repositories.intel.com/graphics/ubuntu focal main' > /etc/apt/sources.list.d/intel.list \
21+
&& \
22+
export ARCH='amd64'; \
23+
export EXTRA_INSTALL_ARG='intel-media-va-driver-non-free nvidia-opencl-icd-340 i965-va-driver mesa-va-drivers'
24+
25+
RUN \
26+
apt-get -qq update \
27+
&& \
28+
apt-get -qq install -y \
29+
gnupg2 \
30+
&& \
31+
apt-get -qq update \
32+
&& \
33+
apt-get -qq install -y \
34+
ca-certificates \
35+
${EXTRA_INSTALL_ARG} \
36+
&& \
37+
curl -fsSL "https://repo.jellyfin.org/ubuntu/jellyfin_team.gpg.key" | apt-key add - && \
38+
echo "deb [arch=amd64] https://repo.jellyfin.org/ubuntu focal main" | tee /etc/apt/sources.list.d/jellyfin.list && \
39+
apt-get -qq update && \
40+
apt-get -qq install -y \
41+
jellyfin-server="${VERSION}*" \
42+
jellyfin-web \
43+
jellyfin-ffmpeg5 \
44+
&& \
45+
apt-get remove -y gnupg2 \
46+
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
47+
&& apt-get autoremove -y \
48+
&& apt-get clean \
49+
&& \
50+
rm -rf \
51+
/tmp/* \
52+
/var/lib/apt/lists/* \
53+
/var/tmp/ \
54+
&& printf "umask %d" "${UMASK}" >> /etc/bash.bashrc
55+
56+
ENV LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libjemalloc.so.2"
57+
58+
USER 568
59+
60+
COPY --chmod=0755 ./apps/jellyfin/promknight-entrypoint.sh /promknight-entrypoint.sh
61+
62+
LABEL org.opencontainers.image.source="https://github.com/jellyfin/jellyfin"

apps/jellyfin/ci/goss.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#process
3+
process:
4+
jellyfin:
5+
running: true
6+
7+
# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#port
8+
port:
9+
# https://github.com/aelsabbahy/goss/issues/149
10+
tcp:8096:
11+
listening: true
12+
13+
# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#http
14+
http:
15+
http://localhost:8096/web/index.html:
16+
status: 200

apps/jellyfin/ci/latest.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
AUTH="Authorization: token ${GH_PAT:-${TOKEN:-}}"
3+
version=$(curl -Lsf -H "$AUTH" "https://api.github.com/repos/jellyfin/jellyfin/releases/latest" | jq --raw-output '. | .tag_name')
4+
version="${version#*v}"
5+
version="${version#*release-}"
6+
printf "%s" "${version}"

apps/jellyfin/metadata.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"app": "jellyfin",
3+
"base": false,
4+
"channels": [
5+
{
6+
"name": "stable",
7+
"platforms": [
8+
"linux/amd64"
9+
],
10+
"stable": true,
11+
"tests": {
12+
"enabled": true,
13+
"type": "web"
14+
}
15+
}
16+
]
17+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
cat << "EOF"
6+
7+
▐▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▌
8+
▐ ▌
9+
▐ ██▓███ ██▀███ ▒█████ ███▄ ▄███▓ ██ ▄█▀ ███▄ █ ██▓ ▄████ ██░ ██ ▄▄▄█████▓ ▌
10+
▐ ▓██░ ██▒▓██ ▒ ██▒▒██▒ ██▒▓██▒▀█▀ ██▒ ██▄█▒ ██ ▀█ █ ▓██▒ ██▒ ▀█▒▓██░ ██▒▓ ██▒ ▓▒ ▌
11+
▐ ▓██░ ██▓▒▓██ ░▄█ ▒▒██░ ██▒▓██ ▓██░▓███▄░ ▓██ ▀█ ██▒▒██▒▒██░▄▄▄░▒██▀▀██░▒ ▓██░ ▒░ ▌
12+
▐ ▒██▄█▓▒ ▒▒██▀▀█▄ ▒██ ██░▒██ ▒██ ▓██ █▄ ▓██▒ ▐▌██▒░██░░▓█ ██▓░▓█ ░██ ░ ▓██▓ ░ ▌
13+
▐ ▒██▒ ░ ░░██▓ ▒██▒░ ████▓▒░▒██▒ ░██▒▒██▒ █▄▒██░ ▓██░░██░░▒▓███▀▒░▓█▒░██▓ ▒██▒ ░ ▌
14+
▐ ▒▓▒░ ░ ░░ ▒▓ ░▒▓░░ ▒░▒░▒░ ░ ▒░ ░ ░▒ ▒▒ ▓▒░ ▒░ ▒ ▒ ░▓ ░▒ ▒ ▒ ░░▒░▒ ▒ ░░ ▌
15+
▐ ░▒ ░ ░▒ ░ ▒░ ░ ▒ ▒░ ░ ░ ░░ ░▒ ▒░░ ░░ ░ ▒░ ▒ ░ ░ ░ ▒ ░▒░ ░ ░ ▌
16+
▐ ░░ ░░ ░ ░ ░ ░ ▒ ░ ░ ░ ░░ ░ ░ ░ ░ ▒ ░░ ░ ░ ░ ░░ ░ ░ ▌
17+
▐ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▌
18+
▐ ▌
19+
▐ Jellyfin ▌
20+
▐▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▌
21+
22+
EOF
23+
24+
exec \
25+
/usr/bin/jellyfin \
26+
--ffmpeg="/usr/lib/jellyfin-ffmpeg/ffmpeg" \
27+
--webdir="/usr/share/jellyfin/web" \
28+
--datadir="/config" \
29+
--cachedir="/config/cache" \
30+
"$@"

0 commit comments

Comments
 (0)