Dockerfile.arm64 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. 10.5.1
  8. RUN apk add curl git \
  9. && curl -L https://github.com/jellyfin/jellyfin-web/archive/${JELLYFIN_WEB_VERSION}.tar.gz | tar zxf - \
  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-arm64 "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none"
  22. FROM multiarch/qemu-user-static:x86_64-aarch64 as qemu
  23. FROM arm64v8/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-aarch64-static /usr/bin
  31. RUN apt-get update && apt-get install --no-install-recommends --no-install-suggests -y \
  32. ffmpeg \
  33. libssl-dev \
  34. ca-certificates \
  35. libfontconfig1 \
  36. libfreetype6 \
  37. libomxil-bellagio0 \
  38. libomxil-bellagio-bin \
  39. && apt-get clean autoclean -y \
  40. && apt-get autoremove -y \
  41. && rm -rf /var/lib/apt/lists/* \
  42. && mkdir -p /cache /config /media \
  43. && chmod 777 /cache /config /media
  44. COPY --from=builder /jellyfin /jellyfin
  45. COPY --from=web-builder /dist /jellyfin/jellyfin-web
  46. ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
  47. EXPOSE 8096
  48. VOLUME /cache /config /media
  49. ENTRYPOINT ["./jellyfin/jellyfin", \
  50. "--datadir", "/config", \
  51. "--cachedir", "/cache", \
  52. "--ffmpeg", "/usr/bin/ffmpeg"]