diff --git a/docker/main/Dockerfile b/docker/main/Dockerfile index 05a45c808..06c54f680 100644 --- a/docker/main/Dockerfile +++ b/docker/main/Dockerfile @@ -223,16 +223,6 @@ RUN --mount=type=bind,source=./requirements-dev.txt,target=/workspace/frigate/re CMD ["sleep", "infinity"] -# Dev Container w/ TRT -FROM devcontainer AS devcontainer-trt - -COPY --from=trt-deps /usr/local/lib/libyolo_layer.so /usr/local/lib/libyolo_layer.so -COPY --from=trt-deps /usr/local/src/tensorrt_demos /usr/local/src/tensorrt_demos -COPY docker/tensorrt/detector/rootfs/ / -COPY --from=trt-deps /usr/local/lib/libyolo_layer.so /usr/local/lib/libyolo_layer.so -RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels \ - pip3 install -U /deps/trt-wheels/*.whl - # Frigate web build # This should be architecture agnostic, so speed up the build on multiarch by not using QEMU. diff --git a/docker/tensorrt/Dockerfile b/docker/tensorrt/Dockerfile index 2e53a3d22..f5e8be54e 100644 --- a/docker/tensorrt/Dockerfile +++ b/docker/tensorrt/Dockerfile @@ -37,3 +37,13 @@ RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels WORKDIR /opt/frigate/ COPY --from=rootfs / / + +# Dev Container w/ TRT +FROM devcontainer AS devcontainer-trt + +COPY --from=trt-deps /usr/local/lib/libyolo_layer.so /usr/local/lib/libyolo_layer.so +COPY --from=trt-deps /usr/local/src/tensorrt_demos /usr/local/src/tensorrt_demos +COPY docker/tensorrt/detector/rootfs/ / +COPY --from=trt-deps /usr/local/lib/libyolo_layer.so /usr/local/lib/libyolo_layer.so +RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels \ + pip3 install -U /deps/trt-wheels/*.whl diff --git a/docker/tensorrt/trt.hcl b/docker/tensorrt/trt.hcl index 409811c3b..64141542e 100644 --- a/docker/tensorrt/trt.hcl +++ b/docker/tensorrt/trt.hcl @@ -13,7 +13,12 @@ target wheels { platforms = ["linux/amd64"] } -target "tensorrt" { +target devcontainer { + dockerfile = "docker/main/Dockerfile" + platforms = ["linux/amd64"] +} + +target tensorrt { dockerfile = "docker/tensorrt/Dockerfile" context = "." contexts = { @@ -22,4 +27,16 @@ target "tensorrt" { wheels = "target:wheels" } platforms = ["linux/amd64"] +} + +target devcontainer-trt { + dockerfile = "docker/tensorrt/Dockerfile" + context = "." + contexts = { + deps = "target:deps", + rootfs = "target:rootfs" + wheels = "target:wheels" + devcontainer = "target:devcontainer + } + platforms = ["linux/amd64"] } \ No newline at end of file