Dockerfile.arm 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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=5.0
  6. FROM node:lts-alpine as web-builder
  7. ARG JELLYFIN_WEB_VERSION=master
  8. RUN apk add curl git zlib zlib-dev autoconf g++ make libpng-dev gifsicle alpine-sdk automake libtool make gcc musl-dev nasm python3 \
  9. && curl -L https://github.com/jellyfin/jellyfin-web/archive/${JELLYFIN_WEB_VERSION}.tar.gz | tar zxf - \
  10. && cd jellyfin-web-* \
  11. && npm ci --no-audit --unsafe-perm \
  12. && mv dist /dist
  13. FROM multiarch/qemu-user-static:x86_64-arm as qemu
  14. FROM arm32v7/debian:buster-slim as app
  15. # https://askubuntu.com/questions/972516/debian-frontend-environment-variable
  16. ARG DEBIAN_FRONTEND="noninteractive"
  17. # http://stackoverflow.com/questions/48162574/ddg#49462622
  18. ARG APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn
  19. # https://github.com/NVIDIA/nvidia-docker/wiki/Installation-(Native-GPU-Support)
  20. ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility"
  21. COPY --from=qemu /usr/bin/qemu-arm-static /usr/bin
  22. RUN apt-get update \
  23. && apt-get install --no-install-recommends --no-install-suggests -y ca-certificates gnupg curl && \
  24. curl -ks https://repo.jellyfin.org/debian/jellyfin_team.gpg.key | apt-key add - && \
  25. curl -ks https://keyserver.ubuntu.com/pks/lookup?op=get\&search=0x6587ffd6536b8826e88a62547876ae518cbcf2f2 | apt-key add - && \
  26. echo 'deb [arch=armhf] https://repo.jellyfin.org/debian buster main' > /etc/apt/sources.list.d/jellyfin.list && \
  27. echo "deb http://ppa.launchpad.net/ubuntu-raspi2/ppa/ubuntu bionic main">> /etc/apt/sources.list.d/raspbins.list && \
  28. apt-get update && \
  29. apt-get install --no-install-recommends --no-install-suggests -y \
  30. jellyfin-ffmpeg \
  31. libssl-dev \
  32. libfontconfig1 \
  33. libfreetype6 \
  34. libomxil-bellagio0 \
  35. libomxil-bellagio-bin \
  36. libraspberrypi0 \
  37. vainfo \
  38. libva2 \
  39. locales \
  40. && apt-get remove curl gnupg -y \
  41. && apt-get clean autoclean -y \
  42. && apt-get autoremove -y \
  43. && rm -rf /var/lib/apt/lists/* \
  44. && mkdir -p /cache /config /media \
  45. && chmod 777 /cache /config /media \
  46. && sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && locale-gen
  47. ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
  48. ENV LC_ALL en_US.UTF-8
  49. ENV LANG en_US.UTF-8
  50. ENV LANGUAGE en_US:en
  51. FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION} as builder
  52. WORKDIR /repo
  53. COPY . .
  54. ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
  55. # Discard objs - may cause failures if exists
  56. RUN find . -type d -name obj | xargs -r rm -r
  57. # Build
  58. RUN dotnet publish Jellyfin.Server --configuration Release --output="/jellyfin" --self-contained --runtime linux-arm "-p:DebugSymbols=false;DebugType=none"
  59. FROM app
  60. COPY --from=builder /jellyfin /jellyfin
  61. COPY --from=web-builder /dist /jellyfin/jellyfin-web
  62. EXPOSE 8096
  63. VOLUME /cache /config /media
  64. ENTRYPOINT ["./jellyfin/jellyfin", \
  65. "--datadir", "/config", \
  66. "--cachedir", "/cache", \
  67. "--ffmpeg", "/usr/lib/jellyfin-ffmpeg/ffmpeg"]