-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.test
More file actions
99 lines (85 loc) · 3.7 KB
/
Copy pathDockerfile.test
File metadata and controls
99 lines (85 loc) · 3.7 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
88
89
90
91
92
93
94
95
96
97
98
99
# GitHub Actions'ta kullanılan Ubuntu 22.04 tabanlı temiz ortam
FROM ubuntu:22.04
# Etkileşimli apt-get sorularını engellemek için
ENV DEBIAN_FRONTEND=noninteractive
# Temel build araçları, deadsnakes PPA ve sistem bağımlılıklarının yüklenmesi
RUN apt-get update -qq && apt-get install -y \
software-properties-common \
curl \
git \
cmake \
ninja-build \
gcc \
g++ \
libssl-dev \
pkg-config \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt-get update -qq \
&& apt-get install -y \
python3.12 \
python3.12-dev \
python3.12-venv \
# Pywebview ve GObject/GTK için gerekli sistem kütüphaneleri
gir1.2-gtk-3.0 \
gir1.2-webkit2-4.0 \
libwebkit2gtk-4.0-37 \
libgirepository1.0-dev \
libcairo2-dev \
libglib2.0-dev \
libegl1 \
libxcb-cursor0 \
libxcb-xinerama0 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-render-util0 \
libxcb-shape0 \
&& rm -rf /var/lib/apt/lists/*
# python ve python3 komutlarını python3.12'ye yönlendirme
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.12 1 \
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1
# pip'in python3.12 için kurulması
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python
# Node.js 22 sürümünün yüklenmesi (Frontend derlemek ve JS testleri için)
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
# liboqs C kütüphanesinin (0.15.0) GitHub workflow ile birebir aynı şekilde derlenmesi
ENV LIBOQS_VERSION=0.15.0
ENV LIBOQS_EXPECTED_COMMIT=97f6b86b1b6d109cfd43cf276ae39c2e776aed80
ENV OQS_INSTALL_PREFIX=/opt/oqs
RUN git clone --branch "$LIBOQS_VERSION" --depth 1 https://github.com/open-quantum-safe/liboqs.git /tmp/liboqs \
&& actual_commit="$(git -C /tmp/liboqs rev-parse HEAD)" \
&& if [ "$actual_commit" != "$LIBOQS_EXPECTED_COMMIT" ]; then \
echo "liboqs source mismatch: expected $LIBOQS_EXPECTED_COMMIT, got $actual_commit" >&2; \
exit 1; \
fi \
&& cmake -S /tmp/liboqs -B /tmp/liboqs/build \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DOQS_BUILD_ONLY_LIB=ON \
-DOQS_DIST_BUILD=ON \
-DCMAKE_INSTALL_PREFIX="$OQS_INSTALL_PREFIX" \
&& cmake --build /tmp/liboqs/build --parallel $(nproc) \
&& cmake --build /tmp/liboqs/build --target install \
&& printf '%s\n' \
"version=$LIBOQS_VERSION" \
"expected_commit=$LIBOQS_EXPECTED_COMMIT" \
"actual_commit=$actual_commit" \
> "$OQS_INSTALL_PREFIX/.paracci-liboqs-source" \
&& rm -rf /tmp/liboqs
# Çevre değişkenlerinin tanımlanması (liboqs-python'un kütüphaneyi bulabilmesi için)
ENV OQS_INSTALL_PATH=$OQS_INSTALL_PREFIX
ENV LIBOQS_LIB_DIR=$OQS_INSTALL_PREFIX/lib
ENV LD_LIBRARY_PATH=$OQS_INSTALL_PREFIX/lib
# GUI testlerinin headless (ekran kartı/arayüz olmadan) çalışabilmesi için
ENV QT_QPA_PLATFORM=offscreen
WORKDIR /workspace
# Hızlı çalışma için bağımlılık dosyalarını kopyalayıp önbellekliyoruz
COPY package.json package-lock.json requirements.lock requirements-dev.lock ./
RUN npm ci
RUN python -m pip install --upgrade pip --break-system-packages \
&& python -m pip install --ignore-installed --break-system-packages --require-hashes -r requirements.lock \
&& python -m pip install --ignore-installed --break-system-packages --require-hashes -r requirements-dev.lock
# Çalıştırılacak varsayılan komut (Derleme + Pytest + JS Testleri)
CMD ["sh", "-c", "python tools/ci/native_verify.py --profile linux-docker"]