# Test image for the autopilot workspace. # # Mirrors the production target (Jetson Orin Nano Super, JetPack 6, Ubuntu # 22.04 LTS aarch64, FFmpeg 4.4, OpenCV 4.8) — see deploy/jetson/README.md. # `ffmpeg-sys-next 8.1` performs compile-time FFmpeg version detection # (sets `ffmpeg_4_4` cfg automatically), so the workspace's `ffmpeg-next # = "8.1"` pin works against Ubuntu 22.04's FFmpeg 4.4 with no code # change. # # Build (on the Jetson): # docker build -t autopilot-test -f Dockerfile.test . # # Run (mount the source so `target/` is cached across runs): # docker run --rm -v "$PWD:/workspace" -w /workspace autopilot-test # # Override the command for ad-hoc work: # docker run --rm -it -v "$PWD:/workspace" -w /workspace autopilot-test \ # cargo test --workspace --no-fail-fast --color always # # First build (cold apt + rustup): ~10-20 min on Jetson Orin Nano Super. # Subsequent builds (only Cargo.toml / sources changed): seconds. FROM ubuntu:22.04 ENV DEBIAN_FRONTEND=noninteractive # Production-matching system deps. Versions resolved from # jammy / jammy-updates / jammy-security so the resulting cargo # build/test environment is identical to what `apt install` would # yield on a clean JetPack 6 Jetson. RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ cmake \ pkg-config \ ca-certificates \ curl \ git \ libssl-dev \ libclang-dev \ clang \ libopencv-dev \ libavcodec-dev \ libavdevice-dev \ libavfilter-dev \ libavformat-dev \ libavutil-dev \ libswscale-dev \ libswresample-dev \ protobuf-compiler \ && rm -rf /var/lib/apt/lists/* # `clang-sys` (used by both opencv-sys and ffmpeg-sys-next via bindgen) # looks for `libclang.so` in the default linker search path. Ubuntu's # `libclang-14-dev` only ships the unversioned symlink under # `/usr/lib/llvm-14/lib/`, so we point at it explicitly. Without # this, the build panics with "a `libclang` shared library is not # loaded on this thread". ENV LIBCLANG_PATH=/usr/lib/llvm-14/lib # Pin to the same Rust toolchain the workspace's rust-toolchain.toml # expects (channel = "stable", profile = "minimal", components = # ["rustfmt", "clippy"]). We pin the patch level here to keep CI # reproducible; the toolchain file overrides via `+stable` if the # Jetson dev wants a moving target. ENV RUSTUP_HOME=/usr/local/rustup \ CARGO_HOME=/usr/local/cargo \ PATH=/usr/local/cargo/bin:$PATH RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ | sh -s -- -y --default-toolchain 1.82.0 --profile minimal \ --component rustfmt --component clippy \ && rustup --version \ && cargo --version \ && rustc --version WORKDIR /workspace # Default to running the full workspace test suite. Override at # `docker run` time when needed. CMD ["cargo", "test", "--workspace", "--no-fail-fast", "--color", "always"]