Skip to content

Commit

Permalink
Merge pull request #33 from Stremio/fix-ffmpeg-install
Browse files Browse the repository at this point in the history
Fix jellyfin-ffmpeg install
  • Loading branch information
elpiel authored Mar 25, 2024
2 parents 848bf01 + 5784186 commit 9c50064
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 291 deletions.
11 changes: 5 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@ ARG JELLYFIN_VERSION=4.4.1-4

# COPY qemu-arm-static /usr/bin/qemu-arm-static

COPY setup_jellyfin_repo.sh setup_jellyfin_repo.sh

RUN ./setup_jellyfin_repo.sh
# No need for updating because the shell script above does that for us.
# RUN apt update

RUN apt install -y jellyfin-ffmpeg=$JELLYFIN_VERSION-$(awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release)
# RUN apt update and install wget
RUN apt -y update && apt -y install wget
RUN wget https://repo.jellyfin.org/archive/ffmpeg/debian/4.4.1-4/jellyfin-ffmpeg_4.4.1-4-buster_$(dpkg --print-architecture).deb -O jellyfin-ffmpeg_4.4.1-4-buster.deb
RUN apt -y install ./jellyfin-ffmpeg_4.4.1-4-buster.deb
RUN rm jellyfin-ffmpeg_4.4.1-4-buster.deb

# RUN apt install -y bash
COPY download_server.sh download_server.sh
Expand Down
27 changes: 10 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ For the **desktop build** (currently, the only supported platform) do not pass t

### Example: Build a Docker image with Server v4.20.1

**NB:** On a new Ubuntu release you must update the [`setup_jellyfin_repo.sh`](./setup_jellyfin_repo.sh) shell script for `jellyfin-ffmpeg`.

If you're cross-building the image from x86 to arm, you need to either use a [QEMU binary or `multiarch/qemu-user-static` (see below)](#cross-building)

- Platform: `linux/amd64` (also used for `linux/x86_64`):
Expand All @@ -52,33 +54,24 @@ If you're cross-building the image from x86 to arm, you need to either use a [QE
Cross building the image from an `x86` to `arm` architecture, you need to either use QEMU emulation binary or the `multiarch/qemu-user-static` docker image.

#### Using QEMU
1. Setup QEMU:
```
apt-get update && apt-get install -y --no-install-recommends qemu-user-static binfmt-support
update-binfmts --enable qemu-arm
update-binfmts --display qemu-arm
```

```
mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:' > /proc/sys/fs/binfmt_misc/register
```

Source: https://matchboxdorry.gitbooks.io/matchboxblog/content/blogs/build_and_run_arm_images.html
2. Build image with attached volume:

Setup `binfmt` if you're not on Docker Desktop, if you are you can skip this step.
See https://docs.docker.com/build/building/multi-platform/#qemu for more details.

`docker run --privileged --rm tonistiigi/binfmt --install all`

- arm/v7
`docker buildx build --platform linux/arm/v7 -v /usr/bin/qemu-arm-static:/usr/bin/qemu-arm-static --build-arg VERSION=v4.20.1 -t stremio/server:latest .`
`docker buildx build --platform linux/arm/v7 --build-arg VERSION=v4.20.1 -t stremio/server:latest .`

- arm64 / arm64/v8
`docker buildx build --platform linux/arm64 --build-arg VERSION=v4.20.1 -t stremio/server:latest .`
`docker buildx build --platform linux/arm64 --build-arg VERSION=v4.20.1 -t stremio/server:latest .`

#### Using `multiarch/qemu-user-static` image

For more details check https://github.com/multiarch/qemu-user-static.

`docker run --rm --privileged multiarch/qemu-user-static --reset -p yes`


- Build a Docker image with a local `server.js` found in the root of the folder:
**Note:** By passing an empty `VERSION` argument you will skip downloading the `server.js` from AWS before overriding it with your local one.

Expand Down
268 changes: 0 additions & 268 deletions setup_jellyfin_repo.sh

This file was deleted.

0 comments on commit 9c50064

Please sign in to comment.