Dockerfile.ci 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. FROM debian:bullseye AS ffmpeg
  2. ARG DEBIAN_FRONTEND=noninteractive
  3. WORKDIR /static
  4. ARG TARGETPLATFORM
  5. RUN echo ${TARGETPLATFORM}
  6. RUN apt update && \
  7. apt install -y --no-install-recommends wget unzip tar ca-certificates xz-utils
  8. RUN if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \
  9. wget https://github.com/Dusk-Labs/ffmpeg-static/releases/download/ffmpeg-all-0.0.1/ffmpeg && \
  10. wget https://github.com/Dusk-Labs/ffmpeg-static/releases/download/ffmpeg-all-0.0.1/ffprobe && \
  11. ls -la . && \
  12. pwd \
  13. ; fi
  14. RUN if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \
  15. wget https://johnvansickle.com/ffmpeg/old-releases/ffmpeg-5.1.1-arm64-static.tar.xz && \
  16. tar --strip-components 1 -xf ffmpeg-5.1.1-arm64-static.tar.xz \
  17. ; fi
  18. RUN if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then \
  19. wget https://johnvansickle.com/ffmpeg/old-releases/ffmpeg-5.1.1-armhf-static.tar.xz && \
  20. tar --strip-components 1 -xf ffmpeg-5.1.1-armhf-static.tar.xz \
  21. ; fi
  22. RUN chmod +x /static/ffmpeg && chmod +x /static/ffprobe
  23. # Smoke Test
  24. #RUN /static/ffmpeg -version
  25. #RUN /static/ffprobe -version
  26. FROM debian:bullseye AS dim
  27. ARG DEBIAN_FRONTEND=noninteractive
  28. ARG TARGETPLATFORM
  29. WORKDIR /dim
  30. COPY bin/ bin/
  31. RUN ls -al bin/
  32. RUN mkdir -p target/
  33. RUN if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \
  34. mv bin/amd64-bin/dim target/dim && \
  35. chmod +x target/dim && \
  36. ls -la target/ . && \
  37. pwd \
  38. ; fi
  39. RUN if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \
  40. mv bin/aarch64-bin/dim target/dim && \
  41. chmod +x target/dim && \
  42. ls -la target/ . && \
  43. pwd \
  44. ; fi
  45. RUN if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then \
  46. mv bin/armhf-bin/dim target/dim && \
  47. chmod +x target/dim && \
  48. ls -la target/ . && \
  49. pwd \
  50. ; fi
  51. FROM debian:bullseye
  52. ENV RUST_BACKTRACE=full
  53. ENV DEBIAN_FRONTEND=noninteractive
  54. RUN apt-get update && apt-get install -y \
  55. ca-certificates \
  56. libfontconfig \
  57. libfribidi0 \
  58. libharfbuzz0b \
  59. libtheora0 \
  60. libva-drm2 \
  61. libva2 \
  62. libvorbis0a \
  63. libvorbisenc2 \
  64. && rm -rf /var/lib/apt/lists/*
  65. COPY --from=ffmpeg /static/ffmpeg /opt/dim/utils/ffmpeg
  66. COPY --from=ffmpeg /static/ffprobe /opt/dim/utils/ffprobe
  67. COPY --from=dim /dim/target/dim /opt/dim/dim
  68. EXPOSE 8000
  69. VOLUME ["/opt/dim/config"]
  70. ENV RUST_LOG=info
  71. WORKDIR /opt/dim
  72. CMD ["./dim"]