2023-11-02 13:55:24 +01:00
|
|
|
# syntax=docker/dockerfile:1.6
|
|
|
|
|
|
|
|
# https://askubuntu.com/questions/972516/debian-frontend-environment-variable
|
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
|
|
|
FROM wheels as rk-wheels
|
|
|
|
COPY docker/main/requirements-wheels.txt /requirements-wheels.txt
|
|
|
|
COPY docker/rockchip/requirements-wheels-rk.txt /requirements-wheels-rk.txt
|
2023-11-15 12:41:55 +01:00
|
|
|
RUN sed -i "/https:\/\//d" /requirements-wheels.txt
|
2023-11-02 13:55:24 +01:00
|
|
|
RUN pip3 wheel --wheel-dir=/rk-wheels -c /requirements-wheels.txt -r /requirements-wheels-rk.txt
|
|
|
|
|
2023-11-17 02:08:41 +01:00
|
|
|
FROM wget as rk-downloads
|
2023-11-02 13:55:24 +01:00
|
|
|
RUN wget -qO librknnrt.so https://github.com/MarcA711/rknpu2/raw/master/runtime/RK3588/Linux/librknn_api/aarch64/librknnrt.so
|
2023-11-15 12:41:55 +01:00
|
|
|
RUN wget -qO ffmpeg https://github.com/MarcA711/Rockchip-FFmpeg-Builds/releases/download/latest/ffmpeg
|
|
|
|
RUN wget -qO ffprobe https://github.com/MarcA711/Rockchip-FFmpeg-Builds/releases/download/latest/ffprobe
|
2023-11-17 02:08:41 +01:00
|
|
|
RUN wget -qO yolov8n-320x320.rknn https://github.com/MarcA711/rknn-models/releases/download/latest/yolov8n-320x320.rknn
|
2023-11-02 13:55:24 +01:00
|
|
|
FROM deps AS rk-deps
|
|
|
|
ARG TARGETARCH
|
|
|
|
|
|
|
|
RUN --mount=type=bind,from=rk-wheels,source=/rk-wheels,target=/deps/rk-wheels \
|
|
|
|
pip3 install -U /deps/rk-wheels/*.whl
|
|
|
|
|
|
|
|
WORKDIR /opt/frigate/
|
|
|
|
COPY --from=rootfs / /
|
2023-11-17 02:08:41 +01:00
|
|
|
COPY --from=rk-downloads /rootfs/librknnrt.so /usr/lib/
|
|
|
|
COPY --from=rk-downloads /rootfs/yolov8n-320x320.rknn /models/
|
2023-11-15 12:41:55 +01:00
|
|
|
|
|
|
|
RUN rm -rf /usr/lib/btbn-ffmpeg/bin/ffmpeg
|
|
|
|
RUN rm -rf /usr/lib/btbn-ffmpeg/bin/ffprobe
|
2023-11-17 02:08:41 +01:00
|
|
|
COPY --from=rk-downloads /rootfs/ffmpeg /usr/lib/btbn-ffmpeg/bin/
|
|
|
|
COPY --from=rk-downloads /rootfs/ffprobe /usr/lib/btbn-ffmpeg/bin/
|
2023-11-15 12:41:55 +01:00
|
|
|
RUN chmod +x /usr/lib/btbn-ffmpeg/bin/ffmpeg
|
|
|
|
RUN chmod +x /usr/lib/btbn-ffmpeg/bin/ffprobe
|