Dockerfile.arm 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # DESIGNED FOR BUILDING ON AMD64 ONLY
  2. #####################################
  3. # Requires binfm_misc registration
  4. # https://github.com/multiarch/qemu-user-static#binfmt_misc-register
  5. ARG DOTNET_VERSION=3.1
  6. FROM node:alpine as web-builder
  7. ARG JELLYFIN_WEB_VERSION=10.5.2
  8. RUN apk add curl git \
  9. && git clone --branch release-10.5.z --single-branch https://github.com/jellyfin/jellyfin-web.git \
  10. && cd jellyfin-web \
  11. && yarn install \
  12. && yarn build \
  13. && mv dist /dist
  14. FROM mcr.microsoft.com/dotnet/core/sdk:${DOTNET_VERSION} as builder
  15. WORKDIR /repo
  16. COPY . .
  17. ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
  18. # Discard objs - may cause failures if exists
  19. RUN find . -type d -name obj | xargs -r rm -r
  20. # Build
  21. RUN dotnet publish Jellyfin.Server --configuration Release --output="/jellyfin" --self-contained --runtime linux-arm "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none"
  22. FROM multiarch/qemu-user-static:x86_64-arm as qemu
  23. FROM arm32v7/debian:buster-slim
  24. # https://askubuntu.com/questions/972516/debian-frontend-environment-variable
  25. ARG DEBIAN_FRONTEND="noninteractive"
  26. # http://stackoverflow.com/questions/48162574/ddg#49462622
  27. ARG APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn
  28. # https://github.com/NVIDIA/nvidia-docker/wiki/Installation-(Native-GPU-Support)
  29. ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility"
  30. COPY --from=qemu /usr/bin/qemu-arm-static /usr/bin
  31. RUN apt-get update \
  32. && apt-get install --no-install-recommends --no-install-suggests -y ca-certificates gnupg curl && \
  33. curl -ks https://repo.jellyfin.org/debian/jellyfin_team.gpg.key | apt-key add - && \
  34. curl -ks https://keyserver.ubuntu.com/pks/lookup?op=get\&search=0x6587ffd6536b8826e88a62547876ae518cbcf2f2 | apt-key add - && \
  35. echo 'deb [arch=armhf] https://repo.jellyfin.org/debian buster main' > /etc/apt/sources.list.d/jellyfin.list && \
  36. echo "deb http://ppa.launchpad.net/ubuntu-raspi2/ppa/ubuntu bionic main">> /etc/apt/sources.list.d/raspbins.list && \
  37. apt-get update && \
  38. apt-get install --no-install-recommends --no-install-suggests -y \
  39. jellyfin-ffmpeg \
  40. libssl-dev \
  41. libfontconfig1 \
  42. libfreetype6 \
  43. libomxil-bellagio0 \
  44. libomxil-bellagio-bin \
  45. libraspberrypi0 \
  46. vainfo \
  47. libva2 \
  48. && apt-get remove curl gnupg -y \
  49. && apt-get clean autoclean -y \
  50. && apt-get autoremove -y \
  51. && rm -rf /var/lib/apt/lists/* \
  52. && mkdir -p /cache /config /media \
  53. && chmod 777 /cache /config /media
  54. COPY --from=builder /jellyfin /jellyfin
  55. COPY --from=web-builder /dist /jellyfin/jellyfin-web
  56. ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
  57. EXPOSE 8096
  58. VOLUME /cache /config /media
  59. ENTRYPOINT ["./jellyfin/jellyfin", \
  60. "--datadir", "/config", \
  61. "--cachedir", "/cache", \
  62. "--ffmpeg", "/usr/lib/jellyfin-ffmpeg"]