-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
87 lines (77 loc) · 2.24 KB
/
Dockerfile
File metadata and controls
87 lines (77 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
FROM ubuntu:24.04
# Install system dependencies
RUN apt-get update && apt-get install -y \
pkg-config \
clang \
libclang-dev \
llvm-dev \
wget \
cmake \
build-essential \
python3 \
python3-pip \
python3-venv \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# Install LLVM 18
RUN apt-get update && apt-get install -y \
llvm-18 \
llvm-18-dev \
llvm-18-tools \
libclang1-18 \
libclang-cpp18 \
&& rm -rf /var/lib/apt/lists/*
# Set LLVM environment variables
ENV LIBCLANG_PATH=/usr/lib/llvm-18/lib
ENV LLVM_CONFIG_PATH=/usr/bin/llvm-config-18
ENV LD_LIBRARY_PATH=/usr/lib/llvm-18/lib:$LD_LIBRARY_PATH
# Build OpenCV 4.12 from source
RUN cd /tmp && \
wget -q https://github.com/opencv/opencv/archive/4.12.0.tar.gz && \
tar -xzf 4.12.0.tar.gz && \
cd opencv-4.12.0 && \
mkdir build && \
cd build && \
cmake \
-DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DWITH_CUDA=OFF \
-DWITH_OPENGL=OFF \
-DWITH_OPENCL=OFF \
-DWITH_TBB=OFF \
-DWITH_IPP=OFF \
-DWITH_1394=OFF \
-DWITH_V4L=OFF \
-DWITH_GTK=OFF \
-DBUILD_TESTS=OFF \
-DBUILD_PERF_TESTS=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_opencv_python2=OFF \
-DBUILD_opencv_python3=OFF \
-DBUILD_opencv_java=OFF \
-DOPENCV_GENERATE_PKGCONFIG=ON \
.. && \
make -j$(nproc) && \
make install && \
ldconfig && \
rm -rf /tmp/opencv-4.12.0
# Set OpenCV environment variables
ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.89
ENV PATH="/root/.cargo/bin:${PATH}"
RUN rustup component add rustfmt clippy
# Install Python dependencies
RUN python3 -m venv /opt/venv && \
. /opt/venv/bin/activate && \
pip install --upgrade pip && \
pip install maturin[patchelf] pytest pytest-benchmark numpy pillow
# Add venv to PATH
ENV PATH="/opt/venv/bin:$PATH"
# Set working directory
WORKDIR /workspace
# Verify installations
RUN which rustc && rustc --version
RUN which cargo-clippy && cargo-clippy --version