-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
193 lines (144 loc) · 4.44 KB
/
Dockerfile
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
ARG ENV
FROM quay.io/centos/centos:stream9 as centos-stream9-env
RUN yum update -y \
&& yum install -y \
clang \
cmake3 \
gdb \
libasan \
lld \
lldb \
llvm \
python3-devel \
python3-pip
ENV CC=clang
RUN pip3 install nuitka==2.3
FROM centos-stream9-env as centos-stream9-asan-env
ENV CFLAGS="-fsanitize=address -fuse-ld=lld -g"
ENV CCFLAGS="-fsanitize=address -fuse-ld=lld -g"
ENV LDFLAGS="-fsanitize=address -fuse-ld=lld -g"
FROM centos-stream9-env as centos-stream9-hwasan-env
ENV CFLAGS="-fsanitize=hwaddress -fuse-ld=lld -g"
ENV CCFLAGS="-fsanitize=hwaddress -fuse-ld=lld -g"
ENV LDFLAGS="-fsanitize=hwaddress -fuse-ld=lld -g"
# FROM ubuntu:20.04 as ubuntu-2004-env
# ENV DEBIAN_FRONTEND=noninteractive
# RUN apt-get update -y \
# && apt-get install -y \
# clang \
# cmake \
# lld \
# llvm \
# python3-dev \
# python3-pip \
# python3-dbg
# RUN pip3 install nuitka==2.3
#
#
#
# FROM ubuntu-2004-env as ubuntu-2004-asan-env
# ENV CC=clang
# ENV CFLAGS="-fsanitize=address -fuse-ld=lld -g"
# ENV CCFLAGS="-fsanitize=address -fuse-ld=lld -g"
# ENV LDFLAGS="-fsanitize=address -fuse-ld=lld -g"
#
#
#
# FROM ubuntu-2004-env as ubuntu-2004-hwasan-env
# ENV CC=clang
# ENV CFLAGS="-fsanitize=hwaddress -fuse-ld=lld -g"
# ENV CCFLAGS="-fsanitize=hwaddress -fuse-ld=lld -g"
# ENV LDFLAGS="-fsanitize=hwaddress -fuse-ld=lld -g"
FROM ubuntu:22.04 as ubuntu-2204-env
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y \
&& apt-get install -y \
cmake \
python3 \
python3-dbg \
python3-pip \
lsb-release \
wget \
software-properties-common \
gnupg
RUN wget https://apt.llvm.org/llvm.sh \
&& chmod +x llvm.sh \
&& ./llvm.sh 19 \
&& ln -s /usr/bin/lld-19 /usr/local/bin/lld \
&& ln -s /usr/bin/clang-19 /usr/local/bin/clang
ENV CC=clang
RUN pip3 install nuitka==2.3
FROM ubuntu-2204-env as ubuntu-2204-asan-env
ENV CFLAGS="-fsanitize=address -fuse-ld=lld -g"
ENV CCFLAGS="-fsanitize=address -fuse-ld=lld -g"
ENV LDFLAGS="-fsanitize=address -fuse-ld=lld -g"
FROM ubuntu-2204-env as ubuntu-2204-hwasan-env
ENV CFLAGS="-fsanitize=hwaddress -fuse-ld=lld -g"
ENV CCFLAGS="-fsanitize=hwaddress -fuse-ld=lld -g"
ENV LDFLAGS="-fsanitize=hwaddress -fuse-ld=lld -g"
FROM ubuntu:24.04 as ubuntu-2404-env
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y \
&& apt-get install -y \
clang \
cmake \
lld \
lldb \
llvm \
python3-dev \
python3-pip \
python3-dbg
ENV CC=clang
RUN pip3 install nuitka==2.3 --break-system-packages
FROM ubuntu-2404-env as ubuntu-2404-asan-env
ENV CFLAGS="-fsanitize=address -fuse-ld=lld -g"
ENV CCFLAGS="-fsanitize=address -fuse-ld=lld -g"
ENV LDFLAGS="-fsanitize=address -fuse-ld=lld -g"
FROM ubuntu-2404-env as ubuntu-2404-hwasan-env
ENV CFLAGS="-fsanitize=hwaddress -fuse-ld=lld -g"
ENV CCFLAGS="-fsanitize=hwaddress -fuse-ld=lld -g"
ENV LDFLAGS="-fsanitize=hwaddress -fuse-ld=lld -g"
FROM ubuntu:24.04 as ubuntu-2404-factory-env
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y \
&& apt-get install -y \
clang \
cmake \
lld \
lldb \
llvm \
python3-dev \
python3-pip \
python3-dbg
ENV CC=clang
RUN pip3 install -U --force-reinstall --break-system-packages "https://github.com/Nuitka/Nuitka/archive/factory.zip"
FROM ubuntu:24.04 as ubuntu-2404-factory-gcc-env
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y \
&& apt-get install -y \
gcc \
cmake \
lld \
lldb \
llvm \
python3-dev \
python3-pip \
python3-dbg
RUN pip3 install -U --force-reinstall --break-system-packages "https://github.com/Nuitka/Nuitka/archive/factory.zip"
FROM ubuntu-2404-factory-env as ubuntu-2404-factory-asan-env
ENV CFLAGS="-fsanitize=address -fuse-ld=lld -g"
ENV CCFLAGS="-fsanitize=address -fuse-ld=lld -g"
ENV LDFLAGS="-fsanitize=address -fuse-ld=lld -g"
FROM ubuntu-2404-factory-env as ubuntu-2404-factory-hwasan-env
ENV CFLAGS="-fsanitize=hwaddress -fuse-ld=lld -g"
ENV CCFLAGS="-fsanitize=hwaddress -fuse-ld=lld -g"
ENV LDFLAGS="-fsanitize=hwaddress -fuse-ld=lld -g"
FROM ${ENV} as src
WORKDIR /code
COPY module module
COPY main.py .
FROM src as without-nuitka
FROM src as with-nuitka
RUN python3 -m nuitka --module --show-scons --include-package=module --debug module \
&& mv module.pyi module_backup.pyi \
&& mv module module_backup