pin dep versions, log message about device perms

This commit is contained in:
aptalca
2021-06-23 10:56:31 -04:00
parent 99b6efd14c
commit 36f190bd08
8 changed files with 123 additions and 117 deletions

View File

@@ -12,34 +12,34 @@ ARG DEBIAN_FRONTEND="noninteractive"
ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility"
RUN \
echo "**** install packages ****" && \
apt-get update && \
apt-get install -y --no-install-recommends \
gnupg && \
echo "**** install jellyfin *****" && \
curl -s https://repo.jellyfin.org/ubuntu/jellyfin_team.gpg.key | apt-key add - && \
echo 'deb [arch=amd64] https://repo.jellyfin.org/ubuntu focal main' > /etc/apt/sources.list.d/jellyfin.list && \
curl -s https://repositories.intel.com/graphics/intel-graphics.key | apt-key add - && \
echo 'deb [arch=amd64] https://repositories.intel.com/graphics/ubuntu focal main' > /etc/apt/sources.list.d/intel-graphics.list && \
if [ -z ${JELLYFIN_RELEASE+x} ]; then \
JELLYFIN="jellyfin"; \
else \
JELLYFIN="jellyfin=${JELLYFIN_RELEASE}"; \
fi && \
apt-get update && \
apt-get install -y --no-install-recommends \
at \
intel-media-va-driver-non-free \
${JELLYFIN} \
libfontconfig1 \
libfreetype6 \
libssl1.1 \
mesa-va-drivers && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
echo "**** install packages ****" && \
apt-get update && \
apt-get install -y --no-install-recommends \
gnupg && \
echo "**** install jellyfin *****" && \
curl -s https://repo.jellyfin.org/ubuntu/jellyfin_team.gpg.key | apt-key add - && \
echo 'deb [arch=amd64] https://repo.jellyfin.org/ubuntu focal main' > /etc/apt/sources.list.d/jellyfin.list && \
curl -s https://repositories.intel.com/graphics/intel-graphics.key | apt-key add - && \
echo 'deb [arch=amd64] https://repositories.intel.com/graphics/ubuntu focal main' > /etc/apt/sources.list.d/intel-graphics.list && \
if [ -z ${JELLYFIN_RELEASE+x} ]; then \
JELLYFIN="jellyfin"; \
else \
JELLYFIN="jellyfin=${JELLYFIN_RELEASE} jellyfin-server=${JELLYFIN_RELEASE} jellyfin-web=${JELLYFIN_RELEASE}"; \
fi && \
apt-get update && \
apt-get install -y --no-install-recommends \
at \
intel-media-va-driver-non-free \
${JELLYFIN} \
libfontconfig1 \
libfreetype6 \
libssl1.1 \
mesa-va-drivers && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
# add local files
COPY root/ /

View File

@@ -12,35 +12,35 @@ ARG DEBIAN_FRONTEND="noninteractive"
ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility"
RUN \
echo "**** install packages ****" && \
apt-get update && \
apt-get install -y --no-install-recommends \
gnupg && \
echo "**** install jellyfin *****" && \
curl -s https://repo.jellyfin.org/ubuntu/jellyfin_team.gpg.key | apt-key add - && \
curl -s https://keyserver.ubuntu.com/pks/lookup?op=get\&search=0x6587ffd6536b8826e88a62547876ae518cbcf2f2 | apt-key add - && \
echo 'deb [arch=arm64] https://repo.jellyfin.org/ubuntu focal main' > /etc/apt/sources.list.d/jellyfin.list && \
echo "deb http://ppa.launchpad.net/ubuntu-raspi2/ppa-nightly/ubuntu focal main">> /etc/apt/sources.list.d/raspbins.list && \
if [ -z ${JELLYFIN_RELEASE+x} ]; then \
JELLYFIN="jellyfin"; \
else \
JELLYFIN="jellyfin=${JELLYFIN_RELEASE}"; \
fi && \
apt-get update && \
apt-get install -y --no-install-recommends \
at \
${JELLYFIN} \
libfontconfig1 \
libfreetype6 \
libomxil-bellagio0 \
libomxil-bellagio-bin \
libraspberrypi0 \
libssl1.1 && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
echo "**** install packages ****" && \
apt-get update && \
apt-get install -y --no-install-recommends \
gnupg && \
echo "**** install jellyfin *****" && \
curl -s https://repo.jellyfin.org/ubuntu/jellyfin_team.gpg.key | apt-key add - && \
curl -s https://keyserver.ubuntu.com/pks/lookup?op=get\&search=0x6587ffd6536b8826e88a62547876ae518cbcf2f2 | apt-key add - && \
echo 'deb [arch=arm64] https://repo.jellyfin.org/ubuntu focal main' > /etc/apt/sources.list.d/jellyfin.list && \
echo "deb http://ppa.launchpad.net/ubuntu-raspi2/ppa-nightly/ubuntu focal main">> /etc/apt/sources.list.d/raspbins.list && \
if [ -z ${JELLYFIN_RELEASE+x} ]; then \
JELLYFIN="jellyfin"; \
else \
JELLYFIN="jellyfin=${JELLYFIN_RELEASE} jellyfin-server=${JELLYFIN_RELEASE} jellyfin-web=${JELLYFIN_RELEASE}"; \
fi && \
apt-get update && \
apt-get install -y --no-install-recommends \
at \
${JELLYFIN} \
libfontconfig1 \
libfreetype6 \
libomxil-bellagio0 \
libomxil-bellagio-bin \
libraspberrypi0 \
libssl1.1 && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
# add local files
COPY root/ /

View File

@@ -12,35 +12,35 @@ ARG DEBIAN_FRONTEND="noninteractive"
ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility"
RUN \
echo "**** install packages ****" && \
apt-get update && \
apt-get install -y --no-install-recommends \
gnupg && \
echo "**** install jellyfin *****" && \
curl -s https://repo.jellyfin.org/ubuntu/jellyfin_team.gpg.key | apt-key add - && \
curl -s https://keyserver.ubuntu.com/pks/lookup?op=get\&search=0x6587ffd6536b8826e88a62547876ae518cbcf2f2 | apt-key add - && \
echo 'deb [arch=armhf] https://repo.jellyfin.org/ubuntu focal main' > /etc/apt/sources.list.d/jellyfin.list && \
echo "deb http://ppa.launchpad.net/ubuntu-raspi2/ppa-nightly/ubuntu focal main">> /etc/apt/sources.list.d/raspbins.list && \
if [ -z ${JELLYFIN_RELEASE+x} ]; then \
JELLYFIN="jellyfin"; \
else \
JELLYFIN="jellyfin=${JELLYFIN_RELEASE}"; \
fi && \
apt-get update && \
apt-get install -y --no-install-recommends \
at \
${JELLYFIN} \
libfontconfig1 \
libfreetype6 \
libomxil-bellagio0 \
libomxil-bellagio-bin \
libraspberrypi0 \
libssl1.1 && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
echo "**** install packages ****" && \
apt-get update && \
apt-get install -y --no-install-recommends \
gnupg && \
echo "**** install jellyfin *****" && \
curl -s https://repo.jellyfin.org/ubuntu/jellyfin_team.gpg.key | apt-key add - && \
curl -s https://keyserver.ubuntu.com/pks/lookup?op=get\&search=0x6587ffd6536b8826e88a62547876ae518cbcf2f2 | apt-key add - && \
echo 'deb [arch=armhf] https://repo.jellyfin.org/ubuntu focal main' > /etc/apt/sources.list.d/jellyfin.list && \
echo "deb http://ppa.launchpad.net/ubuntu-raspi2/ppa-nightly/ubuntu focal main">> /etc/apt/sources.list.d/raspbins.list && \
if [ -z ${JELLYFIN_RELEASE+x} ]; then \
JELLYFIN="jellyfin"; \
else \
JELLYFIN="jellyfin=${JELLYFIN_RELEASE} jellyfin-server=${JELLYFIN_RELEASE} jellyfin-web=${JELLYFIN_RELEASE}"; \
fi && \
apt-get update && \
apt-get install -y --no-install-recommends \
at \
${JELLYFIN} \
libfontconfig1 \
libfreetype6 \
libomxil-bellagio0 \
libomxil-bellagio-bin \
libraspberrypi0 \
libssl1.1 && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
# add local files
COPY root/ /

View File

@@ -327,6 +327,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
## Versions
* **23.06.21:** - Add log message if device permissions are incorrect, pin jellyfin dependency versions to prevent upstream apt repo issues.
* **21.05.21:** - Add nvidia.icd file to fix missing tonemapping using Nvidia HW.
* **20.01.21:** - Add Jellyfin Binary Environmentals
* **20.01.21:** - Deprecate `UMASK_SET` in favor of UMASK in baseimage, see above for more information.

View File

@@ -115,6 +115,7 @@ app_setup_block: |
# changelog
changelogs:
- { date: "23.06.21:", desc: "Add log message if device permissions are incorrect, pin jellyfin dependency versions to prevent upstream apt repo issues." }
- { date: "21.05.21:", desc: "Add nvidia.icd file to fix missing tonemapping using Nvidia HW." }
- { date: "20.01.21:", desc: "Add Jellyfin Binary Environmentals" }
- { date: "20.01.21:", desc: "Deprecate `UMASK_SET` in favor of UMASK in baseimage, see above for more information." }

View File

@@ -2,18 +2,18 @@
# create directories
mkdir -p \
/config/{log,data/transcodes,cache} \
/data \
/transcode
/config/{log,data/transcodes,cache} \
/data \
/transcode
# permissions
chown abc:abc \
/config \
/config/* \
/data \
/config/data/transcodes \
/transcode
/config \
/config/* \
/data \
/config/data/transcodes \
/transcode
if [ -n "$(ls -A /data 2>/dev/null)" ]; then
chown abc:abc \
/data/*
/data/*
fi

View File

@@ -4,21 +4,24 @@ FILES=$(find /dev/dri /dev/dvb /dev/vchiq /dev/vc-mem /dev/video1? -type c -prin
for i in $FILES
do
VIDEO_GID=$(stat -c '%g' "$i")
if ! id -G abc | grep -qw "$VIDEO_GID"; then
VIDEO_NAME=$(getent group "${VIDEO_GID}" | awk -F: '{print $1}')
if [ -z "${VIDEO_NAME}" ]; then
VIDEO_NAME="video$(head /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c8)"
groupadd "$VIDEO_NAME"
groupmod -g "$VIDEO_GID" "$VIDEO_NAME"
fi
usermod -a -G "$VIDEO_NAME" abc
fi
VIDEO_GID=$(stat -c '%g' "$i")
if ! id -G abc | grep -qw "$VIDEO_GID"; then
VIDEO_NAME=$(getent group "${VIDEO_GID}" | awk -F: '{print $1}')
if [ -z "${VIDEO_NAME}" ]; then
VIDEO_NAME="video$(head /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c8)"
groupadd "$VIDEO_NAME"
groupmod -g "$VIDEO_GID" "$VIDEO_NAME"
fi
usermod -a -G "$VIDEO_NAME" abc
if [ $(stat -c '%A' "${i}" | cut -b 8,9) != "rw" ]; then
echo -e "**** The device ${i} does not have group read/write permissions, which might prevent hardware transcode from functioning correctly. To fix it, you can run the following on your docker host: ****\nsudo chmod g+rw ${i}\n"
fi
fi
done
# openmax lib loading
if [ -e "/opt/vc/lib" ] && [ ! -e "/etc/ld.so.conf.d/00-vmcs.conf" ]; then
echo "[jellyfin-init] Pi Libs detected loading"
echo "/opt/vc/lib" > "/etc/ld.so.conf.d/00-vmcs.conf"
ldconfig
echo "[jellyfin-init] Pi Libs detected loading"
echo "/opt/vc/lib" > "/etc/ld.so.conf.d/00-vmcs.conf"
ldconfig
fi

View File

@@ -1,16 +1,17 @@
#!/usr/bin/with-contenv bash
export JELLYFIN_DATA_DIR="/config/data" \
JELLYFIN_CONFIG_DIR="/config" \
JELLYFIN_LOG_DIR="/config/log" \
JELLYFIN_CACHE_DIR="/config/cache"
export \
JELLYFIN_DATA_DIR="/config/data" \
JELLYFIN_CONFIG_DIR="/config" \
JELLYFIN_LOG_DIR="/config/log" \
JELLYFIN_CACHE_DIR="/config/cache"
if [ -n "${UMASK_SET}" ] && [ -z "${UMASK}" ]; then
echo -e "You are using a legacy method of defining umask\nplease update your environment variable from UMASK_SET to UMASK\nto keep the functionality after July 2021"
umask ${UMASK_SET}
echo -e "You are using a legacy method of defining umask\nplease update your environment variable from UMASK_SET to UMASK\nto keep the functionality after July 2021"
umask ${UMASK_SET}
fi
exec \
s6-setuidgid abc /usr/bin/jellyfin \
--ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg \
--webdir=/usr/share/jellyfin/web
s6-setuidgid abc /usr/bin/jellyfin \
--ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg \
--webdir=/usr/share/jellyfin/web