Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Support arm and ppc archs

Alexander242bfea8c69b
diff --git a/docker/prod/Dockerfile b/docker/prod/Dockerfile
index 2484f5a85bf..6f6760823ee 100644
--- a/docker/prod/Dockerfile
+++ b/docker/prod/Dockerfile
@@ -5,6 +5,7 @@ LABEL maintainer="[email protected]"
ARG BUNDLER_VERSION="2.5.13"
ARG NODE_VERSION="20.9.0"
ARG BIM_SUPPORT=true
+ARG USE_JEMALLOC=false
ENV DEBIAN_FRONTEND=noninteractive
ENV BUNDLE_JOBS=8
ENV BUNDLE_RETRY=3
@@ -49,8 +50,6 @@ RUN gem install bundler --version "$BUNDLER_VERSION" --no-document
COPY ./docker/prod/setup/preinstall-common.sh ./docker/prod/setup/preinstall-common.sh
RUN ./docker/prod/setup/preinstall-common.sh
-ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2
-
# stuff required for gems
COPY Gemfile Gemfile.* .ruby-version ./
COPY modules ./modules
diff --git a/docker/prod/setup/preinstall-common.sh b/docker/prod/setup/preinstall-common.sh
index 430c5c0c59b..238d1d0856d 100755
--- a/docker/prod/setup/preinstall-common.sh
+++ b/docker/prod/setup/preinstall-common.sh
@@ -44,7 +44,6 @@ apt-get install -yq --no-install-recommends \
postgresql-client-$NEXT_PGVERSION \
libpq5 \
libffi8 \
- libjemalloc2 \
unrtf \
tesseract-ocr \
poppler-utils \
@@ -53,6 +52,18 @@ apt-get install -yq --no-install-recommends \
libclang-dev \
git
+# Use jemalloc as memory allocator
+if [ "$USE_JEMALLOC" = "true" ]; then
+ apt-get install -yq libjemalloc2
+ if [ "$ARCHITECTURE" = "x64" ]; then
+ LIB_ARCH="x86x64"
+ elif [ "$ARCHITECTURE" = "arm64" ]; then
+ LIB_ARCH="aarch64"
+ elif [ "$ARCHITECTURE" = "ppc64le" ]; then
+ LIB_ARCH="powerpc64le"
+ fi
+ export LD_PRELOAD=/usr/lib/${LIB_ARCH}-linux-gnu/libjemalloc.so.2
+fi
# Specifics for BIM edition
if [ ! "$BIM_SUPPORT" = "false" ]; then
@@ -96,4 +107,3 @@ id $APP_USER || useradd -d /home/$APP_USER -m $APP_USER
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
truncate -s 0 /var/log/*log
-