Skip to content

Commit 24e88ee

Browse files
committed
Combined Dockerfile for CI
1 parent f99b50f commit 24e88ee

File tree

1 file changed

+147
-0
lines changed

1 file changed

+147
-0
lines changed

Dockerfile.combined

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
####################################################################################################
2+
3+
FROM ubuntu:jammy AS base
4+
5+
ENV BUILD_CONFIG=release \
6+
DEBIAN_FRONTEND=noninteractive \
7+
LUAJIT_CC=gcc-10 \
8+
CI=true
9+
10+
RUN sed -Ei 's/(archive|security)\.ubuntu\.com/repo.jztkft.hu/' /etc/apt/sources.list && \
11+
apt-get update && \
12+
apt-get upgrade -y && \
13+
apt-get install -y --no-install-recommends \
14+
ca-certificates \
15+
gzip \
16+
make \
17+
tar \
18+
wget \
19+
xz-utils \
20+
&& \
21+
apt-get clean && \
22+
rm -rf /var/lib/apt/lists/*
23+
24+
VOLUME /build
25+
WORKDIR /build
26+
27+
CMD ["sh", "-c", "exec ./linux-build.sh --arch=$BUILD_ARCHITECTURE --config=$BUILD_CONFIG"]
28+
29+
####################################################################################################
30+
31+
FROM base AS x86
32+
33+
ENV AR=x86_64-linux-gnu-gcc-ar-10 \
34+
CC=x86_64-linux-gnu-gcc-10 \
35+
CXX=x86_64-linux-gnu-g++-10 \
36+
GLIBC_COMPAT=true
37+
38+
COPY utils/compat/glibc_version.h /compat/
39+
40+
####################################################################################################
41+
42+
FROM x86 AS i386
43+
44+
ENV BUILD_ARCHITECTURE=x86 \
45+
LUAJIT_CC="${LUAJIT_CC} -m32"
46+
47+
RUN sed -i 's/deb http/deb \[arch=amd64,i386\] http/' /etc/apt/sources.list && \
48+
dpkg --add-architecture i386 && \
49+
apt-get update && \
50+
apt-get install -y --no-install-recommends \
51+
g++-10-multilib \
52+
gcc-10-multilib \
53+
libmysqlclient-dev:i386 \
54+
libncurses-dev:i386 \
55+
libncursesw6:i386 \
56+
&& \
57+
apt-get clean && \
58+
rm -rf /var/lib/apt/lists/*
59+
60+
COPY utils/compat/glibc_version_x86.redef /compat/glibc_version.redef
61+
RUN mkdir -p /compat/x86 && \
62+
objcopy --redefine-syms=/compat/glibc_version.redef "$($CC -m32 --print-file-name=libstdc++.a)" /compat/x86/libstdc++.a && \
63+
objcopy --redefine-syms=/compat/glibc_version.redef "$($CC -m32 --print-file-name=libmysqlclient.a)" /compat/x86/libmysqlclient.a
64+
65+
####################################################################################################
66+
67+
FROM x86 AS x64
68+
69+
ENV BUILD_ARCHITECTURE=x64
70+
71+
RUN sed -i 's/deb http/deb \[arch=amd64\] http/' /etc/apt/sources.list && \
72+
apt-get update && \
73+
apt-get install -y --no-install-recommends \
74+
g++-10 \
75+
gcc-10 \
76+
libmysqlclient-dev \
77+
libncurses-dev \
78+
libncursesw6 \
79+
&& \
80+
apt-get clean && \
81+
rm -rf /var/lib/apt/lists/*
82+
83+
COPY utils/compat/glibc_version_x64.redef /compat/glibc_version.redef
84+
RUN mkdir -p /compat/x64 && \
85+
objcopy --redefine-syms=/compat/glibc_version.redef "$($CC --print-file-name=libstdc++.a)" /compat/x64/libstdc++.a && \
86+
objcopy --redefine-syms=/compat/glibc_version.redef "$($CC --print-file-name=libmysqlclient.a)" /compat/x64/libmysqlclient.a
87+
88+
####################################################################################################
89+
90+
FROM base AS arm
91+
92+
RUN sed 's/deb http:\/\/.*\/ubuntu/deb http:\/\/ports.ubuntu.com\/ubuntu-ports/' /etc/apt/sources.list > /etc/apt/sources.list.d/ubuntu-ports.list
93+
94+
####################################################################################################
95+
96+
FROM arm AS armhf
97+
98+
ENV BUILD_ARCHITECTURE=arm \
99+
LUAJIT_HOST_CC="i686-linux-gnu-gcc-10 -m32" \
100+
GCC_PREFIX=arm-linux-gnueabihf- \
101+
AR=arm-linux-gnueabihf-ar \
102+
CC=arm-linux-gnueabihf-gcc-10 \
103+
CXX=arm-linux-gnueabihf-g++-10
104+
105+
RUN sed -i 's/deb http/deb \[arch=armhf\] http/' /etc/apt/sources.list.d/ubuntu-ports.list && \
106+
sed -i 's/deb http/deb \[arch=amd64,i386\] http/' /etc/apt/sources.list && \
107+
dpkg --add-architecture armhf && \
108+
dpkg --add-architecture i386 && \
109+
apt-get update && \
110+
apt-get install -y --no-install-recommends \
111+
g++-10-arm-linux-gnueabihf \
112+
gcc-10-arm-linux-gnueabihf \
113+
gcc-10-i686-linux-gnu \
114+
libc6-dev:i386 \
115+
libmysqlclient-dev:armhf \
116+
libncurses-dev:armhf \
117+
libncursesw6:armhf \
118+
&& \
119+
apt-get clean && \
120+
rm -rf /var/lib/apt/lists/*
121+
122+
####################################################################################################
123+
124+
FROM arm AS arm64
125+
126+
ENV BUILD_ARCHITECTURE=arm64 \
127+
GCC_PREFIX=aarch64-linux-gnu- \
128+
AR=aarch64-linux-gnu-ar \
129+
CC=aarch64-linux-gnu-gcc-10 \
130+
CXX=aarch64-linux-gnu-g++-10
131+
132+
RUN sed -i 's/deb http/deb \[arch=arm64\] http/' /etc/apt/sources.list.d/ubuntu-ports.list && \
133+
sed -i 's/deb http/deb \[arch=amd64\] http/' /etc/apt/sources.list && \
134+
dpkg --add-architecture arm64 && \
135+
apt-get update && \
136+
apt-get install -y --no-install-recommends \
137+
g++-10-aarch64-linux-gnu \
138+
gcc-10 \
139+
gcc-10-aarch64-linux-gnu \
140+
libmysqlclient-dev:arm64 \
141+
libncurses-dev:arm64 \
142+
libncursesw6:arm64 \
143+
&& \
144+
apt-get clean && \
145+
rm -rf /var/lib/apt/lists/*
146+
147+
####################################################################################################

0 commit comments

Comments
 (0)