Skip to content

Commit

Permalink
Rebase to noble
Browse files Browse the repository at this point in the history
  • Loading branch information
thespad committed Aug 13, 2024
1 parent fb420bc commit ade15d3
Show file tree
Hide file tree
Showing 20 changed files with 81 additions and 62 deletions.
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

FROM ghcr.io/linuxserver/baseimage-ubuntu:jammy
FROM ghcr.io/linuxserver/baseimage-ubuntu:noble

# set version label
ARG BUILD_DATE
Expand All @@ -14,7 +14,6 @@ ARG DEBIAN_FRONTEND="noninteractive"
# add needed nvidia environment variables for https://github.com/NVIDIA/nvidia-docker
ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility"

# install packages
RUN \
echo "**** install emby ****" && \
mkdir -p \
Expand All @@ -31,9 +30,12 @@ RUN \
mv -t \
/app/emby/ \
/tmp/emby/opt/emby-server/* && \
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/*
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*

# add local files
COPY root/ /
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-jammy
FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-noble

# set version label
ARG BUILD_DATE
Expand All @@ -16,8 +16,6 @@ ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility"

RUN \
echo "**** add emby deps *****" && \
curl -s https://keyserver.ubuntu.com/pks/lookup?op=get\&search=0x6587ffd6536b8826e88a62547876ae518cbcf2f2 | gpg --dearmor | tee /usr/share/keyrings/raspbins.gpg >/dev/null && \
echo "deb [signed-by=/usr/share/keyrings/raspbins.gpg] http://ppa.launchpad.net/ubuntu-raspi2/ppa-nightly/ubuntu focal main">> /etc/apt/sources.list.d/raspbins.list && \
apt-get update && \
apt-get install -y --no-install-recommends \
libomxil-bellagio0 \
Expand All @@ -38,6 +36,7 @@ RUN \
mv -t \
/app/emby/ \
/tmp/emby/opt/emby-server/* && \
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/* \
Expand Down
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ pipeline {
CI_PORT='8096'
CI_SSL='false'
CI_DELAY='120'
CI_DOCKERENV='TZ=US/Pacific'
CI_AUTH='user:password'
CI_DOCKERENV=''
CI_AUTH=''
CI_WEBPATH=''
}
stages {
Expand Down
58 changes: 40 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Find us at:

[Emby](https://emby.media/) organizes video, music, live TV, and photos from personal media libraries and streams them to smart TVs, streaming boxes and mobile devices. This container is packaged as a standalone emby Media Server.

[![emby](https://emby.media/community/uploads/inline/3/55626b855503c_logo800.png)](https://emby.media/)
[![emby](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/emby-logo.png)](https://emby.media/)

## Supported Architectures

Expand Down Expand Up @@ -72,35 +72,55 @@ Webui can be found at `http://<your-ip>:8096`

Emby has very complete and verbose documentation located [here](https://github.com/MediaBrowser/Wiki/wiki) .

Hardware acceleration users for Intel Quicksync and AMD VAAPI will need to mount their /dev/dri video device inside of the container by passing the following command when running or creating the container:
### Hardware Acceleration Enhancements

```--device=/dev/dri:/dev/dri```
This section lists the enhancements we have made for hardware acceleration in this image specifically.

We will automatically ensure the abc user inside of the container has the proper permissions to access this device.

Hardware acceleration users for Nvidia will need to install the container runtime provided by Nvidia on their host, instructions can be found here:

https://github.com/NVIDIA/nvidia-docker
#### OpenMAX (Raspberry Pi)

We automatically add the necessary environment variable that will utilise all the features available on a GPU on the host. Once nvidia-docker is installed on your host you will need to re/create the docker container with the nvidia container runtime `--runtime=nvidia` and add an environment variable `-e NVIDIA_VISIBLE_DEVICES=all` (can also be set to a specific gpu's UUID, this can be discovered by running `nvidia-smi --query-gpu=gpu_name,gpu_uuid --format=csv` ). NVIDIA automatically mounts the GPU and drivers from your host into the emby docker.
Hardware acceleration users for Raspberry Pi MMAL/OpenMAX will need to mount their `/dev/vcsm` and `/dev/vchiq` video devices inside of the container and their system OpenMax libs by passing the following options when running or creating the container:

### OpenMAX (Raspberry Pi)

Hardware acceleration users for Raspberry Pi OpenMAX will need to mount their /dev/vchiq video device inside of the container and their system OpenMax libs by passing the following options when running or creating the container:
```
```text
--device=/dev/vcsm:/dev/vcsm
--device=/dev/vchiq:/dev/vchiq
-v /opt/vc/lib:/opt/vc/lib
```

### V4L2 (Raspberry Pi)
#### V4L2 (Raspberry Pi)

Hardware acceleration users for Raspberry Pi V4L2 will need to mount their /dev/video1X devices inside of the container by passing the following options when running or creating the container:
```
Hardware acceleration users for Raspberry Pi V4L2 will need to mount their `/dev/video1X` devices inside of the container by passing the following options when running or creating the container:

```text
--device=/dev/video10:/dev/video10
--device=/dev/video11:/dev/video11
--device=/dev/video12:/dev/video12
```

### Hardware Acceleration

Many desktop applications need access to a GPU to function properly and even some Desktop Environments have compositor effects that will not function without a GPU. However this is not a hard requirement and all base images will function without a video device mounted into the container.

#### Intel/ATI/AMD

To leverage hardware acceleration you will need to mount /dev/dri video device inside of the container.

```text
--device=/dev/dri:/dev/dri
```

We will automatically ensure the abc user inside of the container has the proper permissions to access this device.

#### Nvidia

Hardware acceleration users for Nvidia will need to install the container runtime provided by Nvidia on their host, instructions can be found here:
https://github.com/NVIDIA/nvidia-container-toolkit

We automatically add the necessary environment variable that will utilise all the features available on a GPU on the host. Once nvidia-container-toolkit is installed on your host you will need to re/create the docker container with the nvidia container runtime `--runtime=nvidia` and add an environment variable `-e NVIDIA_VISIBLE_DEVICES=all` (can also be set to a specific gpu's UUID, this can be discovered by running `nvidia-smi --query-gpu=gpu_name,gpu_uuid --format=csv` ). NVIDIA automatically mounts the GPU and drivers from your host into the container.

#### Arm Devices

Best effort is made to install tools to allow mounting in /dev/dri on Arm devices. In most cases if /dev/dri exists on the host it should just work. If running a Raspberry Pi 4 be sure to enable `dtoverlay=vc4-fkms-v3d` in your usercfg.txt.

## Usage

To help you get started creating a container from this image you can either use docker-compose or the docker cli.
Expand All @@ -118,7 +138,7 @@ services:
- PGID=1000
- TZ=Etc/UTC
volumes:
- /path/to/library:/config
- /path/to/https://emby.media//library:/config
- /path/to/tvseries:/data/tvshows
- /path/to/movies:/data/movies
- /opt/vc/lib:/opt/vc/lib #optional
Expand All @@ -144,7 +164,7 @@ docker run -d \
-e TZ=Etc/UTC \
-p 8096:8096 \
-p 8920:8920 `#optional` \
-v /path/to/library:/config \
-v /path/to/https://emby.media//library:/config \
-v /path/to/tvseries:/data/tvshows \
-v /path/to/movies:/data/movies \
-v /opt/vc/lib:/opt/vc/lib `#optional` \
Expand Down Expand Up @@ -339,6 +359,8 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64

## Versions

* **13.08.24:** - Rebase to Ubuntu Noble.
* **12.02.24:** - Use universal hardware acceleration blurb
* **19.01.24:** - Fix tonemapping so it's done with hw acceleration.
* **06.07.23:** - Deprecate armhf. As announced [here](https://www.linuxserver.io/blog/a-farewell-to-arm-hf)
* **08.06.23:** - Fix package extraction so it doesn't change /tmp perms.
Expand Down
4 changes: 2 additions & 2 deletions jenkins-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ repo_vars:
- CI_PORT='8096'
- CI_SSL='false'
- CI_DELAY='120'
- CI_DOCKERENV='TZ=US/Pacific'
- CI_AUTH='user:password'
- CI_DOCKERENV=''
- CI_AUTH=''
- CI_WEBPATH=''
38 changes: 16 additions & 22 deletions readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# project information
project_name: emby
project_url: "https://emby.media/"
project_logo: "https://emby.media/community/uploads/inline/3/55626b855503c_logo800.png"
project_logo: "https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/emby-logo.png"
project_lsio_github_repo_url: "https://github.com/linuxserver/docker-{{ project_name }}"
project_blurb: "[{{ project_name|capitalize }}]({{ project_url }}) organizes video, music, live TV, and photos from personal media libraries and streams them to smart TVs, streaming boxes and mobile devices. This container is packaged as a standalone emby Media Server."
# supported architectures
Expand All @@ -20,18 +20,13 @@ common_param_env_vars_enabled: true #PGID, PUID, etc
param_container_name: "{{ project_name }}"
param_usage_include_vols: true
param_volumes:
- {vol_path: "/config", vol_host_path: "/path/to/library", desc: "Emby data storage location. *This can grow very large, 50gb+ is likely for a large collection.*"}
- {vol_path: "/config", vol_host_path: "/path/to/{{ project_url }}/library", desc: "Emby data storage location. *This can grow very large, 50gb+ is likely for a large collection.*"}
- {vol_path: "/data/tvshows", vol_host_path: "/path/to/tvseries", desc: "Media goes here. Add as many as needed e.g. `/data/movies`, `/data/tv`, etc."}
- {vol_path: "/data/movies", vol_host_path: "/path/to/movies", desc: "Media goes here. Add as many as needed e.g. `/data/movies`, `/data/tv`, etc."}
param_usage_include_ports: true
param_ports:
- {external_port: "8096", internal_port: "8096", port_desc: "Http webUI."}
param_usage_include_env: true
param_env_vars:
- {env_var: "TZ", env_value: "Europe/London", desc: "Specify a timezone to use EG Europe/London"}
# optional container parameters
opt_param_usage_include_env: false
opt_param_env_vars:
opt_param_usage_include_vols: true
opt_param_volumes:
- {vol_path: "/opt/vc/lib", vol_host_path: "/opt/vc/lib", desc: "Path for Raspberry Pi OpenMAX libs *optional*."}
Expand All @@ -52,36 +47,35 @@ app_setup_block: |
Emby has very complete and verbose documentation located [here](https://github.com/MediaBrowser/Wiki/wiki) .
Hardware acceleration users for Intel Quicksync and AMD VAAPI will need to mount their /dev/dri video device inside of the container by passing the following command when running or creating the container:
### Hardware Acceleration Enhancements
```--device=/dev/dri:/dev/dri```
This section lists the enhancements we have made for hardware acceleration in this image specifically.
We will automatically ensure the abc user inside of the container has the proper permissions to access this device.
#### OpenMAX (Raspberry Pi)
Hardware acceleration users for Nvidia will need to install the container runtime provided by Nvidia on their host, instructions can be found here:
Hardware acceleration users for Raspberry Pi MMAL/OpenMAX will need to mount their `/dev/vcsm` and `/dev/vchiq` video devices inside of the container and their system OpenMax libs by passing the following options when running or creating the container:
https://github.com/NVIDIA/nvidia-docker
We automatically add the necessary environment variable that will utilise all the features available on a GPU on the host. Once nvidia-docker is installed on your host you will need to re/create the docker container with the nvidia container runtime `--runtime=nvidia` and add an environment variable `-e NVIDIA_VISIBLE_DEVICES=all` (can also be set to a specific gpu's UUID, this can be discovered by running `nvidia-smi --query-gpu=gpu_name,gpu_uuid --format=csv` ). NVIDIA automatically mounts the GPU and drivers from your host into the emby docker.
### OpenMAX (Raspberry Pi)
Hardware acceleration users for Raspberry Pi OpenMAX will need to mount their /dev/vchiq video device inside of the container and their system OpenMax libs by passing the following options when running or creating the container:
```
```text
--device=/dev/vcsm:/dev/vcsm
--device=/dev/vchiq:/dev/vchiq
-v /opt/vc/lib:/opt/vc/lib
```
### V4L2 (Raspberry Pi)
#### V4L2 (Raspberry Pi)
Hardware acceleration users for Raspberry Pi V4L2 will need to mount their /dev/video1X devices inside of the container by passing the following options when running or creating the container:
```
Hardware acceleration users for Raspberry Pi V4L2 will need to mount their `/dev/video1X` devices inside of the container by passing the following options when running or creating the container:
```text
--device=/dev/video10:/dev/video10
--device=/dev/video11:/dev/video11
--device=/dev/video12:/dev/video12
```
readme_hwaccel: true
# changelog
changelogs:
- {date: "13.08.24:", desc: "Rebase to Ubuntu Noble."}
- {date: "12.02.24:", desc: "Use universal hardware acceleration blurb"}
- {date: "19.01.24:", desc: "Fix tonemapping so it's done with hw acceleration."}
- {date: "06.07.23:", desc: "Deprecate armhf. As announced [here](https://www.linuxserver.io/blog/a-farewell-to-arm-hf)"}
- {date: "08.06.23:", desc: "Fix package extraction so it doesn't change /tmp perms."}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash

# Create folders
mkdir -p \
Expand Down
1 change: 1 addition & 0 deletions root/etc/s6-overlay/s6-rc.d/init-emby-config/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oneshot
1 change: 1 addition & 0 deletions root/etc/s6-overlay/s6-rc.d/init-emby-config/up
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-emby-config/run
1 change: 0 additions & 1 deletion root/etc/s6-overlay/s6-rc.d/init-emby/type

This file was deleted.

1 change: 0 additions & 1 deletion root/etc/s6-overlay/s6-rc.d/init-emby/up

This file was deleted.

12 changes: 6 additions & 6 deletions root/etc/s6-overlay/s6-rc.d/init-video/run
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash

FILES=$(find /dev/dri /dev/dvb /dev/vchiq /dev/video1? -type c -print 2>/dev/null)
FILES=$(find /dev/dri /dev/dvb -type c -print 2>/dev/null)

for i in $FILES
do
for i in ${FILES}; do
VIDEO_GID=$(stat -c '%g' "${i}")
VIDEO_UID=$(stat -c '%u' "${i}")
# check if user matches device
if id -u abc | grep -qw "${VIDEO_UID}"; then
echo "**** permissions for ${i} are good ****"
else
# check if group matches and that device has group rw
if id -G abc | grep -qw "${VIDEO_GID}" && [ $(stat -c '%A' "${i}" | cut -b 5,6) = "rw" ]; then
if id -G abc | grep -qw "${VIDEO_GID}" && [[ $(stat -c '%A' "${i}" | cut -b 5,6) == "rw" ]]; then
echo "**** permissions for ${i} are good ****"
# check if device needs to be added to video group
elif ! id -G abc | grep -qw "${VIDEO_GID}"; then
# check if video group needs to be created
VIDEO_NAME=$(getent group "${VIDEO_GID}" | awk -F: '{print $1}')
if [ -z "${VIDEO_NAME}" ]; then
if [[ -z "${VIDEO_NAME}" ]]; then
VIDEO_NAME="video$(head /dev/urandom | tr -dc 'a-z0-9' | head -c4)"
groupadd "${VIDEO_NAME}"
groupmod -g "${VIDEO_GID}" "${VIDEO_NAME}"
Expand All @@ -27,7 +27,7 @@ do
usermod -a -G "${VIDEO_NAME}" abc
fi
# check if device has group rw
if [ $(stat -c '%A' "${i}" | cut -b 5,6) != "rw" ]; then
if [[ $(stat -c '%A' "${i}" | cut -b 5,6) != "rw" ]]; then
echo -e "**** The device ${i} does not have group read/write permissions, attempting to fix inside the container. ****"
chmod g+rw "${i}"
fi
Expand Down
2 changes: 1 addition & 1 deletion root/etc/s6-overlay/s6-rc.d/init-video/type
Original file line number Diff line number Diff line change
@@ -1 +1 @@
oneshot
oneshot
2 changes: 1 addition & 1 deletion root/etc/s6-overlay/s6-rc.d/init-video/up
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/etc/s6-overlay/s6-rc.d/init-video/run
/etc/s6-overlay/s6-rc.d/init-video/run
3 changes: 2 additions & 1 deletion root/etc/s6-overlay/s6-rc.d/svc-emby/run
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash

# env settings
APP_DIR="/app/emby"
Expand All @@ -7,7 +8,7 @@ export FONTCONFIG_PATH="${APP_DIR}"/etc/fonts
export OCL_ICD_VENDORS="${APP_DIR}"/extra/etc/OpenCL/vendors
export AMDGPU_IDS="${APP_DIR}"/extra/share/libdrm/amdgpu.ids
export PCI_IDS_PATH="${APP_DIR}"/share/hwdata/pci.ids
if [ -d "/lib/x86_64-linux-gnu" ]; then
if [[ -d "/lib/x86_64-linux-gnu" ]]; then
export LIBVA_DRIVERS_PATH=/usr/lib/x86_64-linux-gnu/dri:"${APP_DIR}"/extra/lib/dri
fi
export SSL_CERT_FILE="${APP_DIR}"/etc/ssl/certs/ca-certificates.crt
Expand Down
2 changes: 1 addition & 1 deletion root/etc/s6-overlay/s6-rc.d/svc-emby/type
Original file line number Diff line number Diff line change
@@ -1 +1 @@
longrun
longrun
Empty file.

0 comments on commit ade15d3

Please sign in to comment.