Dockerfile.arm64 2.1 KB

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