Dockerfile.arm64 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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-aarch64 as qemu
  14. FROM arm64v8/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-aarch64-static /usr/bin
  22. RUN apt-get update && apt-get install --no-install-recommends --no-install-suggests -y \
  23. ffmpeg \
  24. libssl-dev \
  25. ca-certificates \
  26. libfontconfig1 \
  27. libfreetype6 \
  28. libomxil-bellagio0 \
  29. libomxil-bellagio-bin \
  30. locales \
  31. && apt-get clean autoclean -y \
  32. && apt-get autoremove -y \
  33. && rm -rf /var/lib/apt/lists/* \
  34. && mkdir -p /cache /config /media \
  35. && chmod 777 /cache /config /media \
  36. && sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && locale-gen
  37. ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
  38. ENV LC_ALL en_US.UTF-8
  39. ENV LANG en_US.UTF-8
  40. ENV LANGUAGE en_US:en
  41. FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION} as builder
  42. WORKDIR /repo
  43. COPY . .
  44. ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
  45. # Discard objs - may cause failures if exists
  46. RUN find . -type d -name obj | xargs -r rm -r
  47. # Build
  48. RUN dotnet publish Jellyfin.Server --configuration Release --output="/jellyfin" --self-contained --runtime linux-arm64 "-p:DebugSymbols=false;DebugType=none"
  49. FROM app
  50. COPY --from=builder /jellyfin /jellyfin
  51. COPY --from=web-builder /dist /jellyfin/jellyfin-web
  52. EXPOSE 8096
  53. VOLUME /cache /config /media
  54. ENTRYPOINT ["./jellyfin/jellyfin", \
  55. "--datadir", "/config", \
  56. "--cachedir", "/cache", \
  57. "--ffmpeg", "/usr/bin/ffmpeg"]