@@ -3,7 +3,7 @@ ARG COMPILER_VERSION=13
33ARG CLANG_VERSION=19
44
55# First rebuild glibc with a special option and provide some .deb files:
6- FROM ubuntu:24.04 as glibcdebs
6+ FROM ubuntu:24.04 AS glibcdebs
77
88COPY ./static /static
99RUN /static/prepare.sh
@@ -12,52 +12,60 @@ RUN /static/rebuild_glibc.sh
1212# Now prepare a standard Ubuntu image and install the provided .deb files
1313# for glibc as a preparation:
1414
15- FROM ubuntu:24.04 as prepare
15+ FROM ubuntu:24.04 AS prepare
1616
17- RUN apt-get update && apt-get upgrade -y && apt-get install -y libgd3 linux-libc-dev libcrypt-dev libnsl-dev rpcsvc-proto libtirpc-dev
17+ RUN apt-get update --fix-missing && \
18+ apt-get upgrade -y && \
19+ apt-get install -y \
20+ software-properties-common net-tools lsb-release \
21+ build-essential cmake make bison flex python3 ccache git libjemalloc-dev \
22+ vim exuberant-ctags gdb fish psmisc sudo debhelper debconf jq libdb-dev \
23+ gcovr prometheus bc tcpdump liburing-dev cppcheck libopenblas-dev gfortran \
24+ cmake ninja-build git liblapack-dev python3-pip libgd3 linux-libc-dev libcrypt-dev \
25+ libnsl-dev rpcsvc-proto libtirpc-dev curl gnupg gnupg2 \
26+ && rm -rf /var/cache/apt/archives /var/lib/apt/lists
1827
1928COPY --from=glibcdebs /root/debs /debs
2029RUN dpkg -i /debs/*.deb
2130
2231# Now build V8:
2332
24- #FROM ubuntu:24.04 as v81
33+ #FROM ubuntu:24.04 AS v81
2534#
2635#COPY ./tools/build_v8_arm64.sh /tools/build_v8_arm64.sh
2736#RUN /tools/build_v8_arm64.sh
2837#
29- #FROM v81 as v8
38+ #FROM v81 AS v8
3039#
3140#COPY ./tools/install_v8_arm64.sh /tools/install_v8_arm64.sh
3241#RUN /tools/install_v8_arm64.sh
3342
3443# Build OpenMP static library
35- FROM ubuntu:24.04 as openmp
44+ FROM ubuntu:24.04 AS openmp
3645
3746ARG COMPILER_VERSION
3847ARG CLANG_VERSION
3948ARG CLANG_FULL_VERSION
4049
4150RUN apt-get update --fix-missing && \
4251 apt-get upgrade -y && \
43- apt-get install -y software-properties-common net-tools wget gnupg lsb-release
52+ apt-get install -y software-properties-common net-tools curl lsb-release dpkg-dev git \
53+ && rm -rf /var/cache/apt/archives /var/lib/apt/lists
4454
4555WORKDIR /
4656
4757COPY static/llvm.sources ./
4858
4959RUN cat llvm.sources >> /etc/apt/sources.list.d/ubuntu.sources
5060
51- RUN wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
52-
53- RUN apt-get update && apt-get install dpkg-dev -y
61+ RUN curl -o- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
5462
55- RUN apt-get source llvm-${CLANG_VERSION}-dev -y && \
56- apt-get build-dep llvm-${CLANG_VERSION}-dev -y
57-
58- RUN apt-get update --fix-missing && apt-get install -y \
59- clang-${CLANG_VERSION} clang++-${CLANG_VERSION} \
60- cmake ninja-build git
63+ RUN apt-get update --fix-missing && \
64+ apt-get source llvm-${CLANG_VERSION}-dev -y && \
65+ apt-get build-dep -y llvm-${CLANG_VERSION}-dev && \
66+ apt-get update --fix-missing && \
67+ apt-get install -y clang-${CLANG_VERSION} clang++-${CLANG_VERSION} && \
68+ rm -rf /var/cache/apt/archives /var/lib/apt/lists
6169
6270COPY patches/diff_llvm.patch .
6371
@@ -73,14 +81,35 @@ WORKDIR build
7381RUN cmake -G Ninja -DLLVM_ENABLE_PROJECTS="clang;openmp" -DCMAKE_C_COMPILER=clang-${CLANG_VERSION} \
7482 -DCMAKE_CXX_COMPILER=clang++-${CLANG_VERSION} -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLIBOMP_ENABLE_SHARED=OFF \
7583 -DENABLE_OMPT_TOOLS=OFF -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DCMAKE_INSTALL_PREFIX=/usr \
76- -DENABLE_LIBOMPTARGET=OFF -DLIBOMP_INSTALL_ALIASES=OFF ../llvm && ninja
84+ -DENABLE_LIBOMPTARGET=OFF -DLIBOMP_INSTALL_ALIASES=OFF ../llvm && ninja && \
85+ mkdir -p /opt/omp && cp ./lib/libomp.so.5 /opt/omp/libomp.a
7786
78- RUN mkdir -p /opt/omp && cp ./lib/libomp.so.5 /opt/omp/libomp.a
7987
88+ FROM prepare AS nodejs
89+ # yarn for UI build:
90+ ARG NODE_VERSION="20.14.0"
91+ RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash && \
92+ export NVM_DIR="$HOME/.nvm" &&\
93+ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" \
94+ [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" && \
95+ nvm install ${NODE_VERSION} && \
96+ nvm use ${NODE_VERSION} && \
97+ node --version && \
98+ npm install -g yarn && \
99+ ln -s /root/.nvm/versions/node/v${NODE_VERSION}/bin/* /usr/local/bin/
100+
101+
102+ FROM nodejs AS node_modules
103+
104+ RUN cd / ; git clone -n --depth=1 --filter=tree:0 https://github.com/arangodb/arangodb && \
105+ cd /arangodb && git sparse-checkout set --no-cone js/apps/system/_admin/aardvark/APP/react && \
106+ git checkout && \
107+ cd /arangodb/js/apps/system/_admin/aardvark/APP/react && yarn install && mv node_modules / && \
108+ cd / && rm -rf /arangodb && tar -cvJf /root/node_modules.tar.xz node_modules && rm -rf /node_modules
80109
81110# Finally, build the actual build image based on the above preparation:
82111
83- FROM prepare
112+ FROM nodejs
84113
85114MAINTAINER Max Neunhoeffer <
[email protected] >
86115
@@ -94,30 +123,20 @@ ARG SCCACHE_VERSION="0.9.1"
94123ENV COMPILER_VERSION=${COMPILER_VERSION}
95124ENV CLANG_VERSION=${CLANG_VERSION}
96125
97- RUN apt-get update --fix-missing && \
98- apt-get install -y software-properties-common net-tools gnupg2 wget && \
99- apt-get update && \
100- apt-get upgrade -y
101-
102126COPY static/llvm.sources ./
103127
104128RUN cat llvm.sources >> /etc/apt/sources.list.d/ubuntu.sources
105129
106- RUN wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
130+ RUN curl -o - https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
107131
108132ENV DEBIAN_FRONTEND=noninteractive
109133
110134RUN apt-get update --fix-missing && \
111- apt-get install -y build-essential gcc-${COMPILER_VERSION} g++-${COMPILER_VERSION} \
112- cmake make bison flex python3 ccache git libjemalloc-dev vim exuberant-ctags gdb fish \
113- psmisc sudo debhelper debconf jq wget libdb-dev curl gnupg2 gcovr prometheus bc tcpdump \
114- liburing-dev cppcheck clang-${CLANG_VERSION} lldb-${CLANG_VERSION} lld-${CLANG_VERSION} \
115- libc++-${CLANG_VERSION}-dev libc++abi-${CLANG_VERSION}-dev libclang-common-${CLANG_VERSION}-dev \
116- libclang-rt-${CLANG_VERSION}-dev nodejs npm libomp-${CLANG_VERSION}-dev liblapack-dev libopenblas-dev gfortran \
117- && apt-get clean
118-
119- # yarn for UI build:
120- RUN npm install -g yarn
135+ apt-get install -y gcc-${COMPILER_VERSION} g++-${COMPILER_VERSION} \
136+ clang-${CLANG_VERSION} lldb-${CLANG_VERSION} lld-${CLANG_VERSION} \
137+ libc++-${CLANG_VERSION}-dev libc++abi-${CLANG_VERSION}-dev libclang-common-${CLANG_VERSION}-dev \
138+ libclang-rt-${CLANG_VERSION}-dev libomp-${CLANG_VERSION}-dev && \
139+ rm -rf /var/cache/apt/archives /var/lib/apt/lists
121140
122141# sccache for cloud compiler cache:
123142
@@ -136,7 +155,7 @@ COPY --from=openmp /opt/omp /opt/omp
136155
137156COPY ./tools/* /tools/
138157
139- RUN [ "/tools/install.sh", "3.4 ", "1 " ]
158+ RUN [ "/tools/install.sh", "3.5 ", "0 " ]
140159
141160COPY ./scripts /scripts
142161
@@ -150,6 +169,8 @@ RUN LC_ALL="C" update-ccache-symlinks
150169
151170RUN git config --global --add safe.directory '*'
152171
153- RUN apt-get install -y python3-pip && pip3 install py7zr psutil cppcheck-junit --break-system-packages
172+ COPY --from=node_modules /root/node_modules.tar.xz /node_modules.tar.xz
173+
174+ RUN pip3 install py7zr psutil cppcheck-junit lcov_cobertura --break-system-packages
154175
155176CMD [ "/usr/bin/fish" ]
0 commit comments