Dockerfile.arm64 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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: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 python \
  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. && mv dist /dist
  13. FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION} as builder
  14. WORKDIR /repo
  15. COPY . .
  16. ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
  17. # Discard objs - may cause failures if exists
  18. RUN find . -type d -name obj | xargs -r rm -r
  19. # Build
  20. RUN dotnet publish Jellyfin.Server --configuration Release --output="/jellyfin" --self-contained --runtime linux-arm64 "-p:DebugSymbols=false;DebugType=none"
  21. FROM multiarch/qemu-user-static:x86_64-aarch64 as qemu
  22. FROM arm64v8/debian:buster-slim
  23. # https://askubuntu.com/questions/972516/debian-frontend-environment-variable
  24. ARG DEBIAN_FRONTEND="noninteractive"
  25. # http://stackoverflow.com/questions/48162574/ddg#49462622
  26. ARG APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn
  27. # https://github.com/NVIDIA/nvidia-docker/wiki/Installation-(Native-GPU-Support)
  28. ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility"
  29. COPY --from=qemu /usr/bin/qemu-aarch64-static /usr/bin
  30. RUN apt-get update && apt-get install --no-install-recommends --no-install-suggests -y \
  31. ffmpeg \
  32. libssl-dev \
  33. ca-certificates \
  34. libfontconfig1 \
  35. libfreetype6 \
  36. libomxil-bellagio0 \
  37. libomxil-bellagio-bin \
  38. locales \
  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. && sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && locale-gen
  45. COPY --from=builder /jellyfin /jellyfin
  46. COPY --from=web-builder /dist /jellyfin/jellyfin-web
  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. EXPOSE 8096
  52. VOLUME /cache /config /media
  53. ENTRYPOINT ["./jellyfin/jellyfin", \
  54. "--datadir", "/config", \
  55. "--cachedir", "/cache", \
  56. "--ffmpeg", "/usr/bin/ffmpeg"]