|
| 1 | +# Minimal CI runner image that matches the GitHub Actions workflow. |
| 2 | +# Build per libcamera version: |
| 3 | +# docker build -f docker/ci/Dockerfile --build-arg LIBCAMERA_VERSION=v0.5.1 -t libcamera-ci:v0.5.1 . |
| 4 | +# |
| 5 | +# Then run against your workspace: |
| 6 | +# docker run --rm -v "$PWD:/workspace" -w /workspace libcamera-ci:v0.5.1 ./docker/ci/entrypoint.sh |
| 7 | + |
| 8 | +ARG UBUNTU_VERSION=22.04 |
| 9 | +FROM ubuntu:${UBUNTU_VERSION} |
| 10 | + |
| 11 | +ARG LIBCAMERA_VERSION=v0.6.0 |
| 12 | +ENV DEBIAN_FRONTEND=noninteractive |
| 13 | + |
| 14 | +# Install build prerequisites for libcamera and Rust. |
| 15 | +RUN apt-get update && \ |
| 16 | + apt-get install -y --no-install-recommends \ |
| 17 | + build-essential git ninja-build pkg-config clang \ |
| 18 | + python3 python3-pip python3-jinja2 python3-yaml python3-ply \ |
| 19 | + libyaml-dev libssl-dev curl ca-certificates && \ |
| 20 | + rm -rf /var/lib/apt/lists/* |
| 21 | + |
| 22 | +# Meson from apt on 22.04 is too old for older libcamera tags; upgrade via pip. |
| 23 | +RUN pip3 install --no-cache-dir --upgrade pip meson |
| 24 | + |
| 25 | +# Install libcamera (matching the workflow: only vimc pipeline for speed). |
| 26 | +RUN git clone --depth 1 --branch ${LIBCAMERA_VERSION} https://git.libcamera.org/libcamera/libcamera.git /tmp/libcamera && \ |
| 27 | + cd /tmp/libcamera && \ |
| 28 | + meson build -Dipas=vimc -Dpipelines=vimc && \ |
| 29 | + ninja -C build install && \ |
| 30 | + rm -rf /tmp/libcamera |
| 31 | + |
| 32 | +# Install Rust toolchain (stable) with rustfmt/clippy. |
| 33 | +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ |
| 34 | + | sh -s -- -y --profile minimal --component rustfmt,clippy && \ |
| 35 | + . "$HOME/.cargo/env" && \ |
| 36 | + rustc --version && cargo --version |
| 37 | + |
| 38 | +ENV PATH="/root/.cargo/bin:${PATH}" |
| 39 | +# Ensure pkg-config can find the installed libcamera. |
| 40 | +ENV PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/local/lib/x86_64-linux-gnu/pkgconfig:${PKG_CONFIG_PATH}" |
| 41 | + |
| 42 | +WORKDIR /workspace |
| 43 | +COPY docker/ci/entrypoint.sh /usr/local/bin/entrypoint.sh |
| 44 | +ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] |
0 commit comments