Yolo9 docker build fails
I've done lots of searching on getting yolo9 working and am stuck at the build stage. I just subscribed to frigate+ and want to get the most out of my system. It looks like its failing to connect to the debian servers. Is there something obvious I'm missing or did some links break in the script? Terminal command and output pasted below.
server@server:~$ sudo docker build . --build-arg MODEL_SIZE=s --build-arg IMG_SIZE=320 --output . -f- <<'EOF' FROM python:3.11 AS build RUN apt-get update && apt-get install --no-install-recommends -y cmake libgl1 && rm -rf /var/lib/apt/lists/* COPY --from=ghcr.io/astral-sh/uv:0.10.4 /uv /bin/ WORKDIR /yolov9 ADD https://github.com/WongKinYiu/yolov9.git . RUN uv pip install --system -r requirements.txt RUN uv pip install --system onnx==1.18.0 onnxruntime onnx-simplifier==0.4.* onnxscript ARG MODEL_SIZE ARG IMG_SIZE ADD https://github.com/WongKinYiu/yolov9/releases/download/v0.1/yolov9-${MODEL_SIZE}-converted.pt yolov9-${MODEL_SIZE}.pt RUN sed -i "s/ckpt = torch.load(attempt_download(w), map_location='cpu')/ckpt = torch.load(attempt_download(w), map_location='cpu', weights_only=False)/g" models/experimental.py RUN python3 export.py --weights ./yolov9-${MODEL_SIZE}.pt --imgsz ${IMG_SIZE} --simplify --include onnx FROM scratch ARG MODEL_SIZE ARG IMG_SIZE COPY --from=build /yolov9/yolov9-${MODEL_SIZE}.onnx /yolov9-${MODEL_SIZE}-${IMG_EOFE}.onnx [+] Building 734.6s (9/18) docker:default => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 986B 0.0s => [internal] load metadata for ghcr.io/astral-sh/uv:0.10.4 13.4s => [internal] load metadata for docker.io/library/python:3.11 0.8s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => CACHED [build 1/10] FROM docker.io/library/python:3.11@sha256:7bd2bb 0.0s => CACHED [build 8/10] ADD https://github.com/WongKinYiu/yolov9/release 0.9s => CACHED [build 5/10] ADD https://github.com/WongKinYiu/yolov9.git . 2.5s => CACHED FROM ghcr.io/astral-sh/uv:0.10.4@sha256:4cac394b6b72846f8a85a7 0.0s => ERROR [build 2/10] RUN apt-get update && apt-get install --no-inst 721.0s
> [build 2/10] RUN apt-get update && apt-get install --no-install-recommends -y cmake libgl1 && rm -rf /var/lib/apt/lists/*: 60.26 Ign:1 http://deb.debian.org/debian trixie InRelease 120.3 Ign:2 http://deb.debian.org/debian trixie-updates InRelease 180.4 Ign:3 http://deb.debian.org/debian-security trixie-security InRelease 240.4 Ign:1 http://deb.debian.org/debian trixie InRelease 300.5 Ign:2 http://deb.debian.org/debian trixie-updates InRelease 360.6 Ign:3 http://deb.debian.org/debian-security trixie-security InRelease 420.6 Ign:1 http://deb.debian.org/debian trixie InRelease 480.7 Ign:2 http://deb.debian.org/debian trixie-updates InRelease 540.7 Ign:3 http://deb.debian.org/debian-security trixie-security InRelease 600.8 Err:1 http://deb.debian.org/debian trixie InRelease 600.8 Temporary failure resolving 'deb.debian.org' 660.9 Err:2 http://deb.debian.org/debian trixie-updates InRelease 660.9 Temporary failure resolving 'deb.debian.org' 720.9 Err:3 http://deb.debian.org/debian-security trixie-security InRelease 720.9 Temporary failure resolving 'deb.debian.org' 720.9 Reading package lists... 721.0 W: Failed to fetch http://deb.debian.org/debian/dists/trixie/InRelease Temporary failure resolving 'deb.debian.org' 721.0 W: Failed to fetch http://deb.debian.org/debian/dists/trixie-updates/InRelease Temporary failure resolving 'deb.debian.org' 721.0 W: Failed to fetch http://deb.debian.org/debian-security/dists/trixie-security/InRelease Temporary failure resolving 'deb.debian.org' 721.0 W: Some index files failed to download. They have been ignored, or old ones used instead. 721.0 Reading package lists... 721.0 Building dependency tree... 721.0 Reading state information... 721.0 E: Unable to locate package cmake 721.0 E: Unable to locate package libgl1
Dockerfile:2
1 | FROM python:3.11 AS build 2 | >>> RUN apt-get update && apt-get install --no-install-recommends -y cmake libgl1 && rm -rf /var/lib/apt/lists/* 3 | COPY --from=ghcr.io/astral-sh/uv:0.10.4 /uv /bin/ 4 | WORKDIR /yolov9
ERROR: failed to build: failed to solve: process "/bin/sh -c apt-get update && apt-get install --no-install-recommends -y cmake libgl1 && rm -rf /var/lib/apt/lists/*" did not complete successfully: exit code: 100