Dockerfile.arm 2.7 KB

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