fix jemalloc build in dockerfile
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Sun, 9 Jul 2023 13:32:28 +0000 (15:32 +0200)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Sun, 9 Jul 2023 13:32:28 +0000 (15:32 +0200)
Dockerfile

index 651a8ba3d2411b6383a1c175ff35f59b46b5d212..10fb3f13f8edff3d1a754a563d4801be0063c67a 100644 (file)
@@ -20,6 +20,15 @@ RUN set -x \
         cargo \
         git
 
+# build jemalloc
+ARG JEMALLOC_VERSION=5.3.0
+RUN curl -L -s https://github.com/jemalloc/jemalloc/releases/download/${JEMALLOC_VERSION}/jemalloc-${JEMALLOC_VERSION}.tar.bz2 \
+        | tar -xjf - -C /tmp \
+    && cd /tmp/jemalloc-${JEMALLOC_VERSION} \
+    && ./configure \
+    && make \
+    && make install
+
 WORKDIR /wheels
 COPY requirements_all.txt .
 
@@ -43,6 +52,7 @@ RUN python3 -m build --wheel --outdir /wheels --skip-dependency-check
 #####################################################################
 FROM python:${PYTHON_VERSION}-slim AS final-build
 WORKDIR /app
+COPY --from=wheels-builder /usr/local/lib/libjemalloc.so /usr/local/lib/libjemalloc.so
 
 RUN set -x \
     && apt-get update \