Dockerfile.arm 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # Requires binfm_misc registration
  2. # https://github.com/multiarch/qemu-user-static#binfmt_misc-register
  3. ARG DOTNET_VERSION=3.0
  4. FROM node:alpine as web-builder
  5. ARG JELLYFIN_WEB_VERSION=v10.4.3
  6. RUN apk add curl \
  7. && curl -L https://github.com/jellyfin/jellyfin-web/archive/${JELLYFIN_WEB_VERSION}.tar.gz | tar zxf - \
  8. && cd jellyfin-web-* \
  9. && yarn install \
  10. && yarn build \
  11. && mv dist /dist
  12. FROM mcr.microsoft.com/dotnet/core/sdk:${DOTNET_VERSION} as builder
  13. WORKDIR /repo
  14. COPY . .
  15. ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
  16. # TODO Remove or update the sed line when we update dotnet version.
  17. RUN find . -type f -exec sed -i 's/netcoreapp2.1/netcoreapp3.0/g' {} \;
  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-arm "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none"
  22. FROM multiarch/qemu-user-static:x86_64-arm as qemu
  23. FROM mcr.microsoft.com/dotnet/core/runtime:${DOTNET_VERSION}-stretch-slim-arm32v7
  24. COPY --from=qemu /usr/bin/qemu-arm-static /usr/bin
  25. RUN apt-get update \
  26. && apt-get install --no-install-recommends --no-install-suggests -y ffmpeg \
  27. && rm -rf /var/lib/apt/lists/* \
  28. && mkdir -p /cache /config /media \
  29. && chmod 777 /cache /config /media
  30. COPY --from=builder /jellyfin /jellyfin
  31. COPY --from=web-builder /dist /jellyfin/jellyfin-web
  32. EXPOSE 8096
  33. VOLUME /cache /config /media
  34. ENTRYPOINT dotnet /jellyfin/jellyfin.dll \
  35. --datadir /config \
  36. --cachedir /cache \
  37. --ffmpeg /usr/bin/ffmpeg