mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-08-04 13:47:37 +02:00
* Combine base and arm trt detectors * Remove unused deps for amd64 build * Add missing packages and cleanup ldconfig * Expand packages for tensorflow model training * Cleanup * Refactor training to not reserve memory
35 lines
1.1 KiB
Docker
35 lines
1.1 KiB
Docker
# syntax=docker/dockerfile:1.4
|
|
|
|
# https://askubuntu.com/questions/972516/debian-frontend-environment-variable
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
# Globally set pip break-system-packages option to avoid having to specify it every time
|
|
ARG PIP_BREAK_SYSTEM_PACKAGES=1
|
|
|
|
FROM wheels AS trt-wheels
|
|
ARG PIP_BREAK_SYSTEM_PACKAGES
|
|
|
|
# Install TensorRT wheels
|
|
COPY docker/tensorrt/requirements-amd64.txt /requirements-tensorrt.txt
|
|
COPY docker/main/requirements-wheels.txt /requirements-wheels.txt
|
|
RUN pip3 wheel --wheel-dir=/trt-wheels -c /requirements-wheels.txt -r /requirements-tensorrt.txt
|
|
|
|
FROM deps AS frigate-tensorrt
|
|
ARG PIP_BREAK_SYSTEM_PACKAGES
|
|
|
|
RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels \
|
|
pip3 uninstall -y onnxruntime-openvino tensorflow-cpu \
|
|
&& pip3 install -U /deps/trt-wheels/*.whl
|
|
|
|
COPY --from=rootfs / /
|
|
COPY docker/tensorrt/detector/rootfs/etc/ld.so.conf.d /etc/ld.so.conf.d
|
|
RUN ldconfig
|
|
|
|
WORKDIR /opt/frigate/
|
|
|
|
# Dev Container w/ TRT
|
|
FROM devcontainer AS devcontainer-trt
|
|
|
|
RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels \
|
|
pip3 install -U /deps/trt-wheels/*.whl
|